mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix more tests
This commit is contained in:
parent
dcefdc7bf2
commit
4e81f3ac15
@ -1,6 +1,5 @@
|
||||
"""Common tools used for the Tradfri test suite."""
|
||||
|
||||
from copy import deepcopy
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
@ -30,7 +29,7 @@ class CommandStore:
|
||||
get_devices_command = gateway.get_devices()
|
||||
self.register_response(get_devices_command, [device_response.id])
|
||||
get_device_command = gateway.get_device(device_response.id)
|
||||
self.register_response(get_device_command, device_response.dict())
|
||||
self.register_response(get_device_command, device_response.dict(by_alias=True))
|
||||
|
||||
def register_response(self, command: Command, response: Any) -> None:
|
||||
"""Register command response."""
|
||||
@ -61,7 +60,7 @@ class CommandStore:
|
||||
assert observe_command
|
||||
|
||||
device_path = "/".join(str(v) for v in device.path)
|
||||
device_state = deepcopy(device.raw)
|
||||
device_state = device.raw.dict(by_alias=True)
|
||||
|
||||
# Create a default observed state based on the sent commands.
|
||||
for command in self.sent_commands:
|
||||
|
@ -93,7 +93,7 @@ async def test_fan_available(
|
||||
ATTR_AIR_PURIFIER_MODE: 0,
|
||||
},
|
||||
STATE_OFF,
|
||||
None,
|
||||
0,
|
||||
None,
|
||||
),
|
||||
(
|
||||
@ -145,7 +145,7 @@ async def test_fan_available(
|
||||
ATTR_AIR_PURIFIER_MODE: 0,
|
||||
},
|
||||
STATE_OFF,
|
||||
None,
|
||||
0,
|
||||
None,
|
||||
),
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user