Bump pyfritzhome to 0.6.7 (#78324)

This commit is contained in:
Michael 2022-09-15 16:01:55 +02:00 committed by GitHub
parent 8dbe293ae2
commit 6f02f7c6ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 12 deletions

View File

@ -2,7 +2,7 @@
"domain": "fritzbox", "domain": "fritzbox",
"name": "AVM FRITZ!SmartHome", "name": "AVM FRITZ!SmartHome",
"documentation": "https://www.home-assistant.io/integrations/fritzbox", "documentation": "https://www.home-assistant.io/integrations/fritzbox",
"requirements": ["pyfritzhome==0.6.5"], "requirements": ["pyfritzhome==0.6.7"],
"ssdp": [ "ssdp": [
{ {
"st": "urn:schemas-upnp-org:device:fritzbox:1" "st": "urn:schemas-upnp-org:device:fritzbox:1"

View File

@ -87,7 +87,7 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
device_class=SensorDeviceClass.POWER, device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return] suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return]
native_value=lambda device: device.power / 1000 if device.power else 0.0, native_value=lambda device: round((device.power or 0.0) / 1000, 3),
), ),
FritzSensorEntityDescription( FritzSensorEntityDescription(
key="voltage", key="voltage",
@ -96,9 +96,7 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
device_class=SensorDeviceClass.VOLTAGE, device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return] suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return]
native_value=lambda device: device.voltage native_value=lambda device: round((device.voltage or 0.0) / 1000, 2),
if getattr(device, "voltage", None)
else 0.0,
), ),
FritzSensorEntityDescription( FritzSensorEntityDescription(
key="electric_current", key="electric_current",
@ -107,7 +105,7 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
device_class=SensorDeviceClass.CURRENT, device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return] suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return]
native_value=lambda device: device.power / device.voltage / 1000 native_value=lambda device: round(device.power / device.voltage, 3)
if device.power and getattr(device, "voltage", None) if device.power and getattr(device, "voltage", None)
else 0.0, else 0.0,
), ),
@ -118,7 +116,7 @@ SENSOR_TYPES: Final[tuple[FritzSensorEntityDescription, ...]] = (
device_class=SensorDeviceClass.ENERGY, device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING, state_class=SensorStateClass.TOTAL_INCREASING,
suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return] suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return]
native_value=lambda device: device.energy / 1000 if device.energy else 0.0, native_value=lambda device: (device.energy or 0.0) / 1000,
), ),
# Thermostat Sensors # Thermostat Sensors
FritzSensorEntityDescription( FritzSensorEntityDescription(

View File

@ -1566,7 +1566,7 @@ pyforked-daapd==0.1.11
pyfreedompro==1.1.0 pyfreedompro==1.1.0
# homeassistant.components.fritzbox # homeassistant.components.fritzbox
pyfritzhome==0.6.5 pyfritzhome==0.6.7
# homeassistant.components.fronius # homeassistant.components.fronius
pyfronius==0.7.1 pyfronius==0.7.1

View File

@ -1091,7 +1091,7 @@ pyforked-daapd==0.1.11
pyfreedompro==1.1.0 pyfreedompro==1.1.0
# homeassistant.components.fritzbox # homeassistant.components.fritzbox
pyfritzhome==0.6.5 pyfritzhome==0.6.7
# homeassistant.components.fronius # homeassistant.components.fronius
pyfronius==0.7.1 pyfronius==0.7.1

View File

@ -121,7 +121,7 @@ class FritzDeviceSwitchMock(FritzDeviceBaseMock):
battery_level = None battery_level = None
device_lock = "fake_locked_device" device_lock = "fake_locked_device"
energy = 1234 energy = 1234
voltage = 230 voltage = 230000
fw_version = "1.2.3" fw_version = "1.2.3"
has_alarm = False has_alarm = False
has_powermeter = True has_powermeter = True

View File

@ -77,14 +77,14 @@ async def test_setup(hass: HomeAssistant, fritz: Mock):
], ],
[ [
f"{SENSOR_DOMAIN}.{CONF_FAKE_NAME}_voltage", f"{SENSOR_DOMAIN}.{CONF_FAKE_NAME}_voltage",
"230", "230.0",
f"{CONF_FAKE_NAME} Voltage", f"{CONF_FAKE_NAME} Voltage",
ELECTRIC_POTENTIAL_VOLT, ELECTRIC_POTENTIAL_VOLT,
SensorStateClass.MEASUREMENT, SensorStateClass.MEASUREMENT,
], ],
[ [
f"{SENSOR_DOMAIN}.{CONF_FAKE_NAME}_electric_current", f"{SENSOR_DOMAIN}.{CONF_FAKE_NAME}_electric_current",
"0.0246869565217391", "0.025",
f"{CONF_FAKE_NAME} Electric Current", f"{CONF_FAKE_NAME} Electric Current",
ELECTRIC_CURRENT_AMPERE, ELECTRIC_CURRENT_AMPERE,
SensorStateClass.MEASUREMENT, SensorStateClass.MEASUREMENT,