Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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"]
}
49 changes: 49 additions & 0 deletions tests/components/dyson/test_fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,55 @@ 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": "OFF",
"auto": "OFF",
"oscs": "ON",
"oson": "ON",
"nmod": "OFF",
"rhtm": "ON",
"fnst": "FAN",
"ercd": "11E1",
"wacd": "NONE",
"nmdv": "0004",
"fnsp": "0002",
"bril": "0002",
"corf": "ON",
"cflr": "INV",
"hflr": "0095",
"sltm": "OFF",
"osal": "0045",
"osau": "0095",
"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 attributes[dyson.ATTR_CARBON_FILTER] == "INV"
Comment thread
etheralm marked this conversation as resolved.


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