mirror of
https://github.com/home-assistant/core.git
synced 2026-11-06 13:41:27 -04:00
Handle smarttub sensor values being None (#103385)
* [smarttub] handle sensor values being None * empty commit to rerun CI * lint * use const in test * reorder checks * use None instead of STATE_UNKNOWN * empty commit to rerun CI * check for STATE_UNKNOWN in test * empty commit to rerun CI
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import pytest
|
||||
import smarttub
|
||||
|
||||
from homeassistant.const import STATE_UNKNOWN
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
|
||||
@@ -27,6 +28,27 @@ async def test_sensor(
|
||||
assert state.state == expected_state
|
||||
|
||||
|
||||
# https://github.com/home-assistant/core/issues/102339
|
||||
async def test_null_blowoutcycle(
|
||||
spa,
|
||||
spa_state,
|
||||
config_entry,
|
||||
hass: HomeAssistant,
|
||||
) -> None:
|
||||
"""Test blowoutCycle having null value."""
|
||||
|
||||
spa_state.blowout_cycle = None
|
||||
|
||||
config_entry.add_to_hass(hass)
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
entity_id = f"sensor.{spa.brand}_{spa.model}_blowout_cycle"
|
||||
state = hass.states.get(entity_id)
|
||||
assert state is not None
|
||||
assert state.state == STATE_UNKNOWN
|
||||
|
||||
|
||||
async def test_primary_filtration(
|
||||
spa, spa_state, setup_entry, hass: HomeAssistant
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user