Add climate platform to ozw (#35566)

This commit is contained in:
Marcel van der Veldt 2020-05-21 11:19:20 +02:00 committed by GitHub
parent f5a326c51e
commit 5bef1c223d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 879 additions and 1 deletions

View file

@ -21,6 +21,12 @@ def light_data_fixture():
return load_fixture("ozw/light_network_dump.csv")
@pytest.fixture(name="climate_data", scope="session")
def climate_data_fixture():
"""Load climate MQTT data and return it."""
return load_fixture("ozw/climate_network_dump.csv")
@pytest.fixture(name="sent_messages")
def sent_messages_fixture():
"""Fixture to capture sent messages."""
@ -88,3 +94,14 @@ async def binary_sensor_alt_msg_fixture(hass):
message = MQTTMessage(topic=sensor_json["topic"], payload=sensor_json["payload"])
message.encode()
return message
@pytest.fixture(name="climate_msg")
async def climate_msg_fixture(hass):
"""Return a mock MQTT msg with a climate mode change message."""
sensor_json = json.loads(
await hass.async_add_executor_job(load_fixture, "ozw/climate.json")
)
message = MQTTMessage(topic=sensor_json["topic"], payload=sensor_json["payload"])
message.encode()
return message