Add new Econet attributes (#33795)

* Add support to the Econet integration for new attributes: lower_temp, upper_temp, ambient_temp & is_enabled

* Removing support for ambient temperature
pull/33997/head
Richard Powell 2020-04-10 15:37:43 -07:00 committed by GitHub
parent dfc66b2018
commit 5b5a232695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -40,6 +40,10 @@ ATTR_IN_USE = "in_use"
ATTR_START_DATE = "start_date" ATTR_START_DATE = "start_date"
ATTR_END_DATE = "end_date" ATTR_END_DATE = "end_date"
ATTR_LOWER_TEMP = "lower_temp"
ATTR_UPPER_TEMP = "upper_temp"
ATTR_IS_ENABLED = "is_enabled"
SUPPORT_FLAGS_HEATER = SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE SUPPORT_FLAGS_HEATER = SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE
ADD_VACATION_SCHEMA = vol.Schema( ADD_VACATION_SCHEMA = vol.Schema(
@ -164,6 +168,13 @@ class EcoNetWaterHeater(WaterHeaterDevice):
data[ATTR_TODAYS_ENERGY_USAGE] = todays_usage data[ATTR_TODAYS_ENERGY_USAGE] = todays_usage
data[ATTR_IN_USE] = self.water_heater.in_use data[ATTR_IN_USE] = self.water_heater.in_use
if self.water_heater.lower_temp is not None:
data[ATTR_LOWER_TEMP] = round(self.water_heater.lower_temp, 2)
if self.water_heater.upper_temp is not None:
data[ATTR_UPPER_TEMP] = round(self.water_heater.upper_temp, 2)
if self.water_heater.is_enabled is not None:
data[ATTR_IS_ENABLED] = self.water_heater.is_enabled
return data return data
@property @property