mirror of
https://github.com/home-assistant/core.git
synced 2026-11-29 01:02:03 -04:00
Add more sensors to SmartTub integration (#46839)
This commit is contained in:
@@ -47,6 +47,24 @@ def mock_spa():
|
||||
"water": {"temperature": 38},
|
||||
"heater": "ON",
|
||||
"state": "NORMAL",
|
||||
"primaryFiltration": {
|
||||
"cycle": 1,
|
||||
"duration": 4,
|
||||
"lastUpdated": "2021-01-20T11:38:57.014Z",
|
||||
"mode": "NORMAL",
|
||||
"startHour": 2,
|
||||
"status": "INACTIVE",
|
||||
},
|
||||
"secondaryFiltration": {
|
||||
"lastUpdated": "2020-07-09T19:39:52.961Z",
|
||||
"mode": "AWAY",
|
||||
"status": "INACTIVE",
|
||||
},
|
||||
"flowSwitch": "OPEN",
|
||||
"ozone": "OFF",
|
||||
"uv": "OFF",
|
||||
"blowoutCycle": "INACTIVE",
|
||||
"cleanupCycle": "INACTIVE",
|
||||
}
|
||||
return mock_spa
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
from . import trigger_update
|
||||
|
||||
|
||||
async def test_state_update(spa, setup_entry, hass, smarttub_api):
|
||||
"""Test the state entity."""
|
||||
async def test_sensors(spa, setup_entry, hass, smarttub_api):
|
||||
"""Test the sensors."""
|
||||
|
||||
entity_id = f"sensor.{spa.brand}_{spa.model}_state"
|
||||
state = hass.states.get(entity_id)
|
||||
@@ -16,3 +16,23 @@ async def test_state_update(spa, setup_entry, hass, smarttub_api):
|
||||
state = hass.states.get(entity_id)
|
||||
assert state is not None
|
||||
assert state.state == "bad"
|
||||
|
||||
entity_id = f"sensor.{spa.brand}_{spa.model}_flow_switch"
|
||||
state = hass.states.get(entity_id)
|
||||
assert state is not None
|
||||
assert state.state == "open"
|
||||
|
||||
entity_id = f"sensor.{spa.brand}_{spa.model}_ozone"
|
||||
state = hass.states.get(entity_id)
|
||||
assert state is not None
|
||||
assert state.state == "off"
|
||||
|
||||
entity_id = f"sensor.{spa.brand}_{spa.model}_blowout_cycle"
|
||||
state = hass.states.get(entity_id)
|
||||
assert state is not None
|
||||
assert state.state == "inactive"
|
||||
|
||||
entity_id = f"sensor.{spa.brand}_{spa.model}_cleanup_cycle"
|
||||
state = hass.states.get(entity_id)
|
||||
assert state is not None
|
||||
assert state.state == "inactive"
|
||||
|
||||
Reference in New Issue
Block a user