mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add support for Dyson Purecool 2018 Air Purifiers models TP04 and DP04 (#22215)
* initial commit initial commit rewrite tests fix merge issue with fan component fix merge issue with fan component * correct line length * change to sync_setup_component for tests * rename services and move services.yaml * move hepa and carbon filter state from sensor to fan * add test for duplicate entities * fix method call tests * fix docstring
This commit is contained in:
committed by
Martin Hjelmare
parent
1ce622469d
commit
e78709c5f5
@@ -2,16 +2,17 @@
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
from libpurecool.dyson_pure_cool_link import DysonPureCoolLink
|
||||
|
||||
from homeassistant.components.dyson import sensor as dyson
|
||||
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT, \
|
||||
STATE_OFF
|
||||
from homeassistant.components.dyson import sensor as dyson
|
||||
from tests.common import get_test_home_assistant
|
||||
from libpurecoollink.dyson_pure_cool_link import DysonPureCoolLink
|
||||
|
||||
|
||||
def _get_device_without_state():
|
||||
"""Return a valid device provide by Dyson web services."""
|
||||
device = mock.Mock(spec=DysonPureCoolLink)
|
||||
device = mock.Mock()
|
||||
device.name = "Device_name"
|
||||
device.state = None
|
||||
device.environmental_state = None
|
||||
@@ -20,7 +21,7 @@ def _get_device_without_state():
|
||||
|
||||
def _get_with_state():
|
||||
"""Return a valid device with state values."""
|
||||
device = mock.Mock()
|
||||
device = mock.Mock(spec=DysonPureCoolLink)
|
||||
device.name = "Device_name"
|
||||
device.state = mock.Mock()
|
||||
device.state.filter_life = 100
|
||||
|
||||
Reference in New Issue
Block a user