Add detailed status for UptimeRobot (#64879)

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
Simone Chemelli 2022-01-26 16:48:15 +01:00 committed by GitHub
parent eb5c6076af
commit 3f12ce06af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 178 additions and 23 deletions

View file

@ -46,7 +46,10 @@ MOCK_UPTIMEROBOT_CONFIG_ENTRY_DATA = {
"source": config_entries.SOURCE_USER,
}
UPTIMEROBOT_TEST_ENTITY = "binary_sensor.test_monitor"
STATE_UP = "up"
UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY = "binary_sensor.test_monitor"
UPTIMEROBOT_SENSOR_TEST_ENTITY = "sensor.test_monitor"
class MockApiResponseKey(str, Enum):
@ -94,7 +97,8 @@ async def setup_uptimerobot_integration(hass: HomeAssistant) -> MockConfigEntry:
assert await hass.config_entries.async_setup(mock_entry.entry_id)
await hass.async_block_till_done()
assert hass.states.get(UPTIMEROBOT_TEST_ENTITY).state == STATE_ON
assert hass.states.get(UPTIMEROBOT_BINARY_SENSOR_TEST_ENTITY).state == STATE_ON
assert hass.states.get(UPTIMEROBOT_SENSOR_TEST_ENTITY).state == STATE_UP
assert mock_entry.state == config_entries.ConfigEntryState.LOADED
return mock_entry