Fix Flick Electric Pricing (#135154)

This commit is contained in:
Brynley McDonald
2025-01-09 22:09:04 +13:00
committed by GitHub
parent fe8cae8eb5
commit 2f892678f6
4 changed files with 6 additions and 6 deletions

View File

@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"loggers": ["pyflick"],
"requirements": ["PyFlick==1.1.2"]
"requirements": ["PyFlick==1.1.3"]
}

View File

@ -51,19 +51,19 @@ class FlickPricingSensor(CoordinatorEntity[FlickElectricDataCoordinator], Sensor
_LOGGER.warning(
"Unexpected quantity for unit price: %s", self.coordinator.data
)
return self.coordinator.data.cost
return self.coordinator.data.cost * 100
@property
def extra_state_attributes(self) -> dict[str, Any] | None:
"""Return the state attributes."""
components: dict[str, Decimal] = {}
components: dict[str, float] = {}
for component in self.coordinator.data.components:
if component.charge_setter not in ATTR_COMPONENTS:
_LOGGER.warning("Found unknown component: %s", component.charge_setter)
continue
components[component.charge_setter] = component.value
components[component.charge_setter] = float(component.value * 100)
return {
ATTR_START_AT: self.coordinator.data.start_at,

View File

@ -48,7 +48,7 @@ ProgettiHWSW==0.1.3
PyChromecast==14.0.5
# homeassistant.components.flick_electric
PyFlick==1.1.2
PyFlick==1.1.3
# homeassistant.components.flume
PyFlume==0.6.5

View File

@ -45,7 +45,7 @@ ProgettiHWSW==0.1.3
PyChromecast==14.0.5
# homeassistant.components.flick_electric
PyFlick==1.1.2
PyFlick==1.1.3
# homeassistant.components.flume
PyFlume==0.6.5