1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Bump hatasmota from 0.0.27 (#42802)

* Adjust tests

* Add test for deprecated discovery message

* Update status sensors

* Bump hatasmota to 0.0.27

* Update tests
This commit is contained in:
Erik Montnemery
2020-11-08 17:11:25 +01:00
committed by GitHub
parent 6e9b65405a
commit 51b4bc547c
10 changed files with 167 additions and 44 deletions

View File

@@ -6,7 +6,7 @@ from homeassistant.components.tasmota.const import DEFAULT_PREFIX
from homeassistant.components.tasmota.discovery import ALREADY_DISCOVERED
from .conftest import setup_tasmota_helper
from .test_common import DEFAULT_CONFIG
from .test_common import DEFAULT_CONFIG, DEFAULT_CONFIG_9_0_0_3
from tests.async_mock import patch
from tests.common import async_fire_mqtt_message
@@ -132,6 +132,29 @@ async def test_device_discover(
assert device_entry.sw_version == config["sw"]
async def test_device_discover_deprecated(
hass, mqtt_mock, caplog, device_reg, entity_reg, setup_tasmota
):
"""Test setting up a device with deprecated discovery message."""
config = copy.deepcopy(DEFAULT_CONFIG_9_0_0_3)
mac = config["mac"]
async_fire_mqtt_message(
hass,
f"{DEFAULT_PREFIX}/{mac}/config",
json.dumps(config),
)
await hass.async_block_till_done()
# Verify device and registry entries are created
device_entry = device_reg.async_get_device(set(), {("mac", mac)})
assert device_entry is not None
assert device_entry.manufacturer == "Tasmota"
assert device_entry.model == config["md"]
assert device_entry.name == config["dn"]
assert device_entry.sw_version == config["sw"]
async def test_device_update(
hass, mqtt_mock, caplog, device_reg, entity_reg, setup_tasmota
):