Title and internal descriptions updates for Fritzbox (#49047)

This commit is contained in:
Simone Chemelli 2021-05-03 12:52:22 +02:00 committed by GitHub
parent 779f34a8ed
commit 1ad9f1d714
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 20 additions and 19 deletions

View file

@ -1,4 +1,4 @@
"""Support for AVM Fritz!Box smarthome devices.""" """Support for AVM FRITZ!SmartHome devices."""
from __future__ import annotations from __future__ import annotations
from datetime import timedelta from datetime import timedelta
@ -28,7 +28,7 @@ from .const import CONF_CONNECTIONS, CONF_COORDINATOR, DOMAIN, LOGGER, PLATFORMS
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up the AVM Fritz!Box platforms.""" """Set up the AVM FRITZ!SmartHome platforms."""
fritz = Fritzhome( fritz = Fritzhome(
host=entry.data[CONF_HOST], host=entry.data[CONF_HOST],
user=entry.data[CONF_USERNAME], user=entry.data[CONF_USERNAME],
@ -93,7 +93,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unloading the AVM Fritz!Box platforms.""" """Unloading the AVM FRITZ!SmartHome platforms."""
fritz = hass.data[DOMAIN][entry.entry_id][CONF_CONNECTIONS] fritz = hass.data[DOMAIN][entry.entry_id][CONF_CONNECTIONS]
await hass.async_add_executor_job(fritz.logout) await hass.async_add_executor_job(fritz.logout)

View file

@ -20,7 +20,7 @@ from .const import CONF_COORDINATOR, DOMAIN as FRITZBOX_DOMAIN
async def async_setup_entry( async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None: ) -> None:
"""Set up the Fritzbox binary sensor from ConfigEntry.""" """Set up the FRITZ!SmartHome binary sensor from ConfigEntry."""
entities = [] entities = []
coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR] coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR]
@ -45,7 +45,7 @@ async def async_setup_entry(
class FritzboxBinarySensor(FritzBoxEntity, BinarySensorEntity): class FritzboxBinarySensor(FritzBoxEntity, BinarySensorEntity):
"""Representation of a binary Fritzbox device.""" """Representation of a binary FRITZ!SmartHome device."""
@property @property
def is_on(self): def is_on(self):

View file

@ -1,4 +1,4 @@
"""Support for AVM Fritz!Box smarthome thermostate devices.""" """Support for AVM FRITZ!SmartHome thermostate devices."""
from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import ( from homeassistant.components.climate.const import (
ATTR_HVAC_MODE, ATTR_HVAC_MODE,
@ -54,7 +54,7 @@ OFF_REPORT_SET_TEMPERATURE = 0.0
async def async_setup_entry( async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None: ) -> None:
"""Set up the Fritzbox smarthome thermostat from ConfigEntry.""" """Set up the FRITZ!SmartHome thermostat from ConfigEntry."""
entities = [] entities = []
coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR] coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR]
@ -79,7 +79,7 @@ async def async_setup_entry(
class FritzboxThermostat(FritzBoxEntity, ClimateEntity): class FritzboxThermostat(FritzBoxEntity, ClimateEntity):
"""The thermostat class for Fritzbox smarthome thermostates.""" """The thermostat class for FRITZ!SmartHome thermostates."""
@property @property
def supported_features(self): def supported_features(self):
@ -159,6 +159,7 @@ class FritzboxThermostat(FritzBoxEntity, ClimateEntity):
return PRESET_COMFORT return PRESET_COMFORT
if self.device.target_temperature == self.device.eco_temperature: if self.device.target_temperature == self.device.eco_temperature:
return PRESET_ECO return PRESET_ECO
return None
@property @property
def preset_modes(self): def preset_modes(self):

View file

@ -1,4 +1,4 @@
"""Config flow for AVM Fritz!Box.""" """Config flow for AVM FRITZ!SmartHome."""
from urllib.parse import urlparse from urllib.parse import urlparse
from pyfritzhome import Fritzhome, LoginError from pyfritzhome import Fritzhome, LoginError
@ -37,7 +37,7 @@ RESULT_SUCCESS = "success"
class FritzboxConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): class FritzboxConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a AVM Fritz!Box config flow.""" """Handle a AVM FRITZ!SmartHome config flow."""
VERSION = 1 VERSION = 1

View file

@ -1,4 +1,4 @@
"""Constants for the AVM Fritz!Box integration.""" """Constants for the AVM FRITZ!SmartHome integration."""
import logging import logging
ATTR_STATE_BATTERY_LOW = "battery_low" ATTR_STATE_BATTERY_LOW = "battery_low"

View file

@ -1,4 +1,4 @@
"""Support for AVM Fritz!Box smarthome temperature sensor only devices.""" """Support for AVM FRITZ!SmartHome temperature sensor only devices."""
from homeassistant.components.sensor import SensorEntity from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
@ -25,7 +25,7 @@ from .const import (
async def async_setup_entry( async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None: ) -> None:
"""Set up the Fritzbox smarthome sensor from ConfigEntry.""" """Set up the FRITZ!SmartHome sensor from ConfigEntry."""
entities = [] entities = []
coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR] coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR]
@ -66,7 +66,7 @@ async def async_setup_entry(
class FritzBoxBatterySensor(FritzBoxEntity, SensorEntity): class FritzBoxBatterySensor(FritzBoxEntity, SensorEntity):
"""The entity class for Fritzbox sensors.""" """The entity class for FRITZ!SmartHome sensors."""
@property @property
def state(self): def state(self):
@ -75,7 +75,7 @@ class FritzBoxBatterySensor(FritzBoxEntity, SensorEntity):
class FritzBoxTempSensor(FritzBoxEntity, SensorEntity): class FritzBoxTempSensor(FritzBoxEntity, SensorEntity):
"""The entity class for Fritzbox temperature sensors.""" """The entity class for FRITZ!SmartHome temperature sensors."""
@property @property
def state(self): def state(self):

View file

@ -1,6 +1,6 @@
{ {
"config": { "config": {
"flow_title": "AVM FRITZ!Box: {name}", "flow_title": "AVM FRITZ!SmartHome: {name}",
"step": { "step": {
"user": { "user": {
"description": "Enter your AVM FRITZ!Box information.", "description": "Enter your AVM FRITZ!Box information.",

View file

@ -1,4 +1,4 @@
"""Support for AVM Fritz!Box smarthome switch devices.""" """Support for AVM FRITZ!SmartHome switch devices."""
from homeassistant.components.switch import SwitchEntity from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ( from homeassistant.const import (
@ -30,7 +30,7 @@ ATTR_TOTAL_CONSUMPTION_UNIT_VALUE = ENERGY_KILO_WATT_HOUR
async def async_setup_entry( async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None: ) -> None:
"""Set up the Fritzbox smarthome switch from ConfigEntry.""" """Set up the FRITZ!SmartHome switch from ConfigEntry."""
entities = [] entities = []
coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR] coordinator = hass.data[FRITZBOX_DOMAIN][entry.entry_id][CONF_COORDINATOR]
@ -55,7 +55,7 @@ async def async_setup_entry(
class FritzboxSwitch(FritzBoxEntity, SwitchEntity): class FritzboxSwitch(FritzBoxEntity, SwitchEntity):
"""The switch class for Fritzbox switches.""" """The switch class for FRITZ!SmartHome switches."""
@property @property
def available(self): def available(self):