Skip to content

Commit

Permalink
Merge pull request #96 from ribbal/master
Browse files Browse the repository at this point in the history
Replace deprecated device_state_attributes
  • Loading branch information
MindrustUK committed Dec 13, 2021
2 parents 72af142 + 34b7f37 commit 531f01f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions custom_components/heatmiserneo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
HVAC_MODE_HEAT_COOL,
HVAC_MODE_OFF,
SUPPORT_TARGET_TEMPERATURE,
SUPPORT_TARGET_TEMPERATURE_RANGE,
SUPPORT_TARGET_TEMPERATURE_RANGE
)
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.helpers.update_coordinator import (
Expand Down Expand Up @@ -162,14 +162,10 @@ def target_temperature_step(self):
return self._target_temperature_step

@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the additional state attributes."""
attributes = {}
# Exclude attribute if floor temperature is 127 or higher
# (V1 of the NeoStat reports 127 when no probe is connected, V2 reports 127.5)
if float(self.data.current_floor_temperature) < 127:
attributes['floor_temperature'] = float(self.data.current_floor_temperature)

attributes['floor_temperature'] = float(self.data.current_floor_temperature)
return attributes

@property
Expand Down Expand Up @@ -264,4 +260,3 @@ async def async_set_hvac_mode(self, hvac_mode):
set_frost_task = asyncio.create_task(self._neostat.set_frost(frost))
response = await set_frost_task
_LOGGER.info(f"{self.name} : Called set_frost() with: {frost} (response: {response})")

0 comments on commit 531f01f

Please sign in to comment.