File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
custom_components/octopus_energy Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -123,15 +123,15 @@ class OctoHeatPumpControllerConfiguration(BaseModel):
123123
124124
125125class OctoHeatPumpLivePerformance (BaseModel ):
126- coefficientOfPerformance : str
126+ coefficientOfPerformance : str | None
127127 heatOutput : ValueAndUnit
128128 powerInput : ValueAndUnit
129129 outdoorTemperature : ValueAndUnit
130130 readAt : str
131131
132132
133133class OctoHeatPumpLifetimePerformance (BaseModel ):
134- seasonalCoefficientOfPerformance : str
134+ seasonalCoefficientOfPerformance : str | None
135135 heatOutput : ValueAndUnit
136136 energyInput : ValueAndUnit
137137 readAt : str
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ def _handle_coordinator_update(self) -> None:
7373 and result .data .octoHeatPumpLifetimePerformance is not None ):
7474 _LOGGER .debug (f"Updating OctopusEnergyHeatPumpSensorLifetimeSCoP for '{ self ._heat_pump_id } '" )
7575
76- self ._state = float (result .data .octoHeatPumpLifetimePerformance .seasonalCoefficientOfPerformance )
76+ self ._state = float (result .data .octoHeatPumpLifetimePerformance .seasonalCoefficientOfPerformance ) if result . data . octoHeatPumpLifetimePerformance . seasonalCoefficientOfPerformance is not None else None
7777 self ._attributes ["read_at" ] = datetime .fromisoformat (result .data .octoHeatPumpLifetimePerformance .readAt )
7878 self ._last_updated = current
7979
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def _handle_coordinator_update(self) -> None:
7676 self ._state = 0
7777 # Only update the CoP if heat pump is actively running
7878 if float (result .data .octoHeatPumpLivePerformance .powerInput .value ) != 0 :
79- self ._state = float (result .data .octoHeatPumpLivePerformance .coefficientOfPerformance )
79+ self ._state = float (result .data .octoHeatPumpLivePerformance .coefficientOfPerformance ) if result . data . octoHeatPumpLivePerformance . coefficientOfPerformanc is not None else None
8080
8181 self ._attributes ["read_at" ] = datetime .fromisoformat (result .data .octoHeatPumpLivePerformance .readAt )
8282 self ._last_updated = current
You can’t perform that action at this time.
0 commit comments