Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ homeassistant/components/discogs/* @thibmaek
homeassistant/components/doorbird/* @oblogic7
homeassistant/components/dsmr_reader/* @depl0y
homeassistant/components/dweet/* @fabaff
homeassistant/components/dyson/* @etheralm
homeassistant/components/ecobee/* @marthoc
homeassistant/components/ecovacs/* @OverloadUT
homeassistant/components/egardia/* @jeroenterheerdt
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/dyson/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ def hepa_filter(self):
@property
def carbon_filter(self):
"""Return the carbon filter state."""
if self._device.state.carbon_filter_state == "INV":
return self._device.state.carbon_filter_state
return int(self._device.state.carbon_filter_state)

@property
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/dyson/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"documentation": "https://www.home-assistant.io/integrations/dyson",
"requirements": ["libpurecool==0.6.0"],
"dependencies": [],
"codeowners": []
"codeowners": ["@etheralm"]
}
61 changes: 61 additions & 0 deletions tests/components/dyson/test_fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,67 @@ async def test_purecool_update_state(devices, login, hass):
assert attributes[dyson.ATTR_DYSON_SPEED_LIST] == _get_supported_speeds()


@asynctest.patch("libpurecool.dyson.DysonAccount.login", return_value=True)
@asynctest.patch(
"libpurecool.dyson.DysonAccount.devices",
return_value=[_get_dyson_purecool_device()],
)
async def test_purecool_update_state_filter_inv(devices, login, hass):
"""Test state TP06 carbon filter state."""
device = devices.return_value[0]
await async_setup_component(hass, dyson.DYSON_DOMAIN, _get_config())
await hass.async_block_till_done()
event = {
"msg": "CURRENT-STATE",
"product-state": {
"fpwr": "OFF",
"fdir": "ON",
"auto": "ON",
"oscs": "ON",
"oson": "ON",
"nmod": "ON",
"rhtm": "ON",
"fnst": "FAN",
"ercd": "11E1",
"wacd": "NONE",
"nmdv": "0004",
"fnsp": "0002",
"bril": "0002",
"corf": "ON",
"cflr": "INV",
"hflr": "0075",
"sltm": "OFF",
"osal": "0055",
"osau": "0105",
"ancp": "CUST",
},
}
device.state = DysonPureCoolV2State(json.dumps(event))

for call in device.add_message_listener.call_args_list:
callback = call[0][0]
if type(callback.__self__) == dyson.DysonPureCoolDevice:
callback(device.state)

await hass.async_block_till_done()
fan_state = hass.states.get("fan.living_room")
attributes = fan_state.attributes

assert fan_state.state == "off"
assert attributes[dyson.ATTR_NIGHT_MODE] is True
assert attributes[dyson.ATTR_AUTO_MODE] is True
assert attributes[dyson.ATTR_ANGLE_LOW] == 55
assert attributes[dyson.ATTR_ANGLE_HIGH] == 105
assert attributes[dyson.ATTR_FLOW_DIRECTION_FRONT] is True
assert attributes[dyson.ATTR_TIMER] == "OFF"
assert attributes[dyson.ATTR_HEPA_FILTER] == 75
assert attributes[dyson.ATTR_CARBON_FILTER] == "INV"
Comment thread
etheralm marked this conversation as resolved.
assert attributes[dyson.ATTR_DYSON_SPEED] == int(FanSpeed.FAN_SPEED_2.value)
assert attributes[ATTR_SPEED] is SPEED_LOW
assert attributes[ATTR_OSCILLATING] is False
assert attributes[dyson.ATTR_DYSON_SPEED_LIST] == _get_supported_speeds()


@asynctest.patch("libpurecool.dyson.DysonAccount.login", return_value=True)
@asynctest.patch(
"libpurecool.dyson.DysonAccount.devices",
Expand Down