Correct docstrings in Advantage Air (#75344)

This commit is contained in:
Brett Adams 2022-07-17 22:00:01 +10:00 committed by GitHub
parent ba8a530d19
commit 2eebda63fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 17 deletions

View File

@ -21,7 +21,7 @@ async def async_setup_entry(
config_entry: ConfigEntry, config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback, async_add_entities: AddEntitiesCallback,
) -> None: ) -> None:
"""Set up AdvantageAir motion platform.""" """Set up AdvantageAir Binary Sensor platform."""
instance = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id] instance = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
@ -39,13 +39,13 @@ async def async_setup_entry(
class AdvantageAirFilter(AdvantageAirEntity, BinarySensorEntity): class AdvantageAirFilter(AdvantageAirEntity, BinarySensorEntity):
"""Advantage Air Filter.""" """Advantage Air Filter sensor."""
_attr_device_class = BinarySensorDeviceClass.PROBLEM _attr_device_class = BinarySensorDeviceClass.PROBLEM
_attr_entity_category = EntityCategory.DIAGNOSTIC _attr_entity_category = EntityCategory.DIAGNOSTIC
def __init__(self, instance, ac_key): def __init__(self, instance, ac_key):
"""Initialize an Advantage Air Filter.""" """Initialize an Advantage Air Filter sensor."""
super().__init__(instance, ac_key) super().__init__(instance, ac_key)
self._attr_name = f'{self._ac["name"]} filter' self._attr_name = f'{self._ac["name"]} filter'
self._attr_unique_id = ( self._attr_unique_id = (
@ -59,12 +59,12 @@ class AdvantageAirFilter(AdvantageAirEntity, BinarySensorEntity):
class AdvantageAirZoneMotion(AdvantageAirEntity, BinarySensorEntity): class AdvantageAirZoneMotion(AdvantageAirEntity, BinarySensorEntity):
"""Advantage Air Zone Motion.""" """Advantage Air Zone Motion sensor."""
_attr_device_class = BinarySensorDeviceClass.MOTION _attr_device_class = BinarySensorDeviceClass.MOTION
def __init__(self, instance, ac_key, zone_key): def __init__(self, instance, ac_key, zone_key):
"""Initialize an Advantage Air Zone Motion.""" """Initialize an Advantage Air Zone Motion sensor."""
super().__init__(instance, ac_key, zone_key) super().__init__(instance, ac_key, zone_key)
self._attr_name = f'{self._zone["name"]} motion' self._attr_name = f'{self._zone["name"]} motion'
self._attr_unique_id = ( self._attr_unique_id = (
@ -78,13 +78,13 @@ class AdvantageAirZoneMotion(AdvantageAirEntity, BinarySensorEntity):
class AdvantageAirZoneMyZone(AdvantageAirEntity, BinarySensorEntity): class AdvantageAirZoneMyZone(AdvantageAirEntity, BinarySensorEntity):
"""Advantage Air Zone MyZone.""" """Advantage Air Zone MyZone sensor."""
_attr_entity_registry_enabled_default = False _attr_entity_registry_enabled_default = False
_attr_entity_category = EntityCategory.DIAGNOSTIC _attr_entity_category = EntityCategory.DIAGNOSTIC
def __init__(self, instance, ac_key, zone_key): def __init__(self, instance, ac_key, zone_key):
"""Initialize an Advantage Air Zone MyZone.""" """Initialize an Advantage Air Zone MyZone sensor."""
super().__init__(instance, ac_key, zone_key) super().__init__(instance, ac_key, zone_key)
self._attr_name = f'{self._zone["name"]} myZone' self._attr_name = f'{self._zone["name"]} myZone'
self._attr_unique_id = ( self._attr_unique_id = (

View File

@ -40,7 +40,7 @@ async def async_setup_entry(
class AdvantageAirZoneVent(AdvantageAirEntity, CoverEntity): class AdvantageAirZoneVent(AdvantageAirEntity, CoverEntity):
"""Advantage Air Cover Class.""" """Advantage Air Zone Vent."""
_attr_device_class = CoverDeviceClass.DAMPER _attr_device_class = CoverDeviceClass.DAMPER
_attr_supported_features = ( _attr_supported_features = (
@ -50,7 +50,7 @@ class AdvantageAirZoneVent(AdvantageAirEntity, CoverEntity):
) )
def __init__(self, instance, ac_key, zone_key): def __init__(self, instance, ac_key, zone_key):
"""Initialize an Advantage Air Cover Class.""" """Initialize an Advantage Air Zone Vent."""
super().__init__(instance, ac_key, zone_key) super().__init__(instance, ac_key, zone_key)
self._attr_name = self._zone["name"] self._attr_name = self._zone["name"]
self._attr_unique_id = ( self._attr_unique_id = (

View File

@ -15,7 +15,7 @@ async def async_setup_entry(
config_entry: ConfigEntry, config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback, async_add_entities: AddEntitiesCallback,
) -> None: ) -> None:
"""Set up AdvantageAir toggle platform.""" """Set up AdvantageAir select platform."""
instance = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id] instance = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
@ -49,7 +49,7 @@ class AdvantageAirMyZone(AdvantageAirEntity, SelectEntity):
@property @property
def current_option(self): def current_option(self):
"""Return the fresh air status.""" """Return the current MyZone."""
return self._number_to_name[self._ac["myZone"]] return self._number_to_name[self._ac["myZone"]]
async def async_select_option(self, option): async def async_select_option(self, option):

View File

@ -17,7 +17,7 @@ async def async_setup_entry(
config_entry: ConfigEntry, config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback, async_add_entities: AddEntitiesCallback,
) -> None: ) -> None:
"""Set up AdvantageAir toggle platform.""" """Set up AdvantageAir switch platform."""
instance = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id] instance = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]

View File

@ -34,7 +34,7 @@ from tests.components.advantage_air import (
async def test_climate_async_setup_entry(hass, aioclient_mock): async def test_climate_async_setup_entry(hass, aioclient_mock):
"""Test climate setup.""" """Test climate platform."""
aioclient_mock.get( aioclient_mock.get(
TEST_SYSTEM_URL, TEST_SYSTEM_URL,

View File

@ -27,7 +27,7 @@ from tests.components.advantage_air import (
async def test_cover_async_setup_entry(hass, aioclient_mock): async def test_cover_async_setup_entry(hass, aioclient_mock):
"""Test climate setup without sensors.""" """Test cover platform."""
aioclient_mock.get( aioclient_mock.get(
TEST_SYSTEM_URL, TEST_SYSTEM_URL,

View File

@ -19,7 +19,7 @@ from tests.components.advantage_air import (
async def test_select_async_setup_entry(hass, aioclient_mock): async def test_select_async_setup_entry(hass, aioclient_mock):
"""Test climate setup without sensors.""" """Test select platform."""
aioclient_mock.get( aioclient_mock.get(
TEST_SYSTEM_URL, TEST_SYSTEM_URL,
@ -36,7 +36,7 @@ async def test_select_async_setup_entry(hass, aioclient_mock):
assert len(aioclient_mock.mock_calls) == 1 assert len(aioclient_mock.mock_calls) == 1
# Test Select Entity # Test MyZone Select Entity
entity_id = "select.testname_ac_one_myzone" entity_id = "select.testname_ac_one_myzone"
state = hass.states.get(entity_id) state = hass.states.get(entity_id)
assert state assert state

View File

@ -23,7 +23,7 @@ from tests.components.advantage_air import (
async def test_cover_async_setup_entry(hass, aioclient_mock): async def test_cover_async_setup_entry(hass, aioclient_mock):
"""Test climate setup without sensors.""" """Test switch platform."""
aioclient_mock.get( aioclient_mock.get(
TEST_SYSTEM_URL, TEST_SYSTEM_URL,