After merge, review. (#51139)

This commit is contained in:
jan iversen 2021-05-27 08:28:31 +02:00 committed by GitHub
parent fdfb84e8e2
commit 8d365e8bf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -52,8 +52,7 @@ async def async_setup_platform(
hub = hass.data[MODBUS_DOMAIN][discovery_info[CONF_NAME]] hub = hass.data[MODBUS_DOMAIN][discovery_info[CONF_NAME]]
sensors.append(ModbusRegisterSensor(hub, entry)) sensors.append(ModbusRegisterSensor(hub, entry))
if len(sensors) > 0: async_add_entities(sensors)
async_add_entities(sensors)
class ModbusRegisterSensor(BasePlatform, RestoreEntity, SensorEntity): class ModbusRegisterSensor(BasePlatform, RestoreEntity, SensorEntity):

View File

@ -210,7 +210,7 @@ async def test_config_wrong_struct_sensor(
expect_setup_to_fail=True, expect_setup_to_fail=True,
) )
assert error_message in "".join(caplog.messages) assert error_message in caplog.text
@pytest.mark.parametrize( @pytest.mark.parametrize(