Don't create certain start.ca sensors for unlimited plans (#98525)
Don't create certain startca sensors for unlimited setups
This commit is contained in:
parent
4eb0f1cf37
commit
8ed7d2dd3e
2 changed files with 15 additions and 20 deletions
|
@ -157,18 +157,15 @@ async def test_unlimited_setup(
|
|||
await async_setup_component(hass, "sensor", {"sensor": config})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
state = hass.states.get("sensor.start_ca_usage_ratio")
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE
|
||||
assert state.state == "0"
|
||||
# These sensors should not be created for unlimited setups
|
||||
assert hass.states.get("sensor.start_ca_usage_ratio") is None
|
||||
assert hass.states.get("sensor.start_ca_data_limit") is None
|
||||
assert hass.states.get("sensor.start_ca_remaining") is None
|
||||
|
||||
state = hass.states.get("sensor.start_ca_usage")
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfInformation.GIGABYTES
|
||||
assert state.state == "0.0"
|
||||
|
||||
state = hass.states.get("sensor.start_ca_data_limit")
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfInformation.GIGABYTES
|
||||
assert state.state == "inf"
|
||||
|
||||
state = hass.states.get("sensor.start_ca_used_download")
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfInformation.GIGABYTES
|
||||
assert state.state == "0.0"
|
||||
|
@ -201,10 +198,6 @@ async def test_unlimited_setup(
|
|||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfInformation.GIGABYTES
|
||||
assert state.state == "6.48"
|
||||
|
||||
state = hass.states.get("sensor.start_ca_remaining")
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfInformation.GIGABYTES
|
||||
assert state.state == "inf"
|
||||
|
||||
|
||||
async def test_bad_return_code(
|
||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue