1
0
mirror of https://github.com/home-assistant/core.git synced 2026-03-05 09:07:40 +00:00
Files
core/tests/components/squeezebox/test_sensor.py
Phill (pssc) a16ef5b7ff Add squeezebox service sensors (#125349)
* Add server sensors

* Fix Platforms order

* Fix spelling

* Fix translations

* Add sensor test

* Case changes

* refactor to use native_value attr override

* Fix typing

* Fix cast to type

* add cast

* use update platform for LMS versions

* Fix translation

* remove update entity

* remove possible update entites

* Fix and clarify

* update to icon trans remove update plaform entitiy supporting items

* add UOM to sensors

* correct criptic prettier fail

* reword other players

* Apply suggestions from code review

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-10 17:17:26 +02:00

30 lines
784 B
Python

"""Test squeezebox sensors."""
from unittest.mock import patch
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from . import FAKE_QUERY_RESPONSE, setup_mocked_integration
async def test_sensor(hass: HomeAssistant) -> None:
"""Test binary sensor states and attributes."""
# Setup component
with (
patch(
"homeassistant.components.squeezebox.PLATFORMS",
[Platform.SENSOR],
),
patch(
"homeassistant.components.squeezebox.Server.async_query",
return_value=FAKE_QUERY_RESPONSE,
),
):
await setup_mocked_integration(hass)
state = hass.states.get("sensor.fakelib_player_count")
assert state is not None
assert state.state == "10"