Skip to content

Commit

Permalink
readded some properties that got accidentally removed
Browse files Browse the repository at this point in the history
  • Loading branch information
pwesters committed Feb 11, 2022
1 parent 358118a commit 367ed41
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 6 deletions.
12 changes: 11 additions & 1 deletion custom_components/watts_vision/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, wattsClient: WattsApi, smartHome: str, id: str):
self.client = wattsClient
self.smartHome = smartHome
self.id = id
self._name = "watts_vision_is_heating"
self._name = "Heating"
self._state: bool = False
self._available = True

Expand All @@ -60,6 +60,16 @@ def unique_id(self) -> str:
"""Return the unique ID of the sensor."""
return "thermostat_is_heating_" + self.id

@property
def name(self) -> str:
"""Return the name of the entity."""
return self._name

@property
def is_on(self):
"""Return the state of the sensor."""
return self._state

@property
def device_info(self):
return {
Expand Down
7 changes: 6 additions & 1 deletion custom_components/watts_vision/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, wattsClient: WattsApi, smartHome: str, id: str, deviceID: str
self.smartHome = smartHome
self.id = id
self.deviceID = deviceID
self._name = "watts_thermostat"
self._name = "Thermostat"
self._available = True
self._attr_extra_state_attributes = {"previous_gv_mode": "0"}

Expand All @@ -90,6 +90,11 @@ def unique_id(self):
"""Return the unique ID for this device."""
return "watts_thermostat_" + self.id

@property
def name(self) -> str:
"""Return the name of the entity."""
return self._name

@property
def supported_features(self):
return SUPPORT_TARGET_TEMPERATURE | SUPPORT_PRESET_MODE
Expand Down
35 changes: 31 additions & 4 deletions custom_components/watts_vision/sensor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Watts Vision sensor platform."""
from datetime import timedelta
import logging
from typing import Callable
from typing import Callable, Optional

from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -68,7 +68,7 @@ def __init__(self, wattsClient: WattsApi, smartHome: str, id: str):
self.client = wattsClient
self.smartHome = smartHome
self.id = id
self._name = "watts_thermostat"
self._name = "Heating mode"
self._state = None
self._available = True

Expand All @@ -77,6 +77,15 @@ def unique_id(self) -> str:
"""Return the unique ID of the sensor."""
return "thermostat_mode_" + self.id

@property
def name(self) -> str:
"""Return the name of the entity."""
return self._name

@property
def state(self) -> Optional[str]:
return self._state

@property
def device_info(self):
return {
Expand Down Expand Up @@ -119,7 +128,7 @@ def __init__(self, wattsClient: WattsApi, smartHome: str, id: str):
self.client = wattsClient
self.smartHome = smartHome
self.id = id
self._name = "watts_vision_air_temperature"
self._name = "Air temperature"
self._state = None
self._available = True

Expand All @@ -128,6 +137,15 @@ def unique_id(self) -> str:
"""Return the unique ID of the sensor."""
return "temperature_air_" + self.id

@property
def name(self) -> str:
"""Return the name of the entity."""
return self._name

@property
def state(self) -> Optional[str]:
return self._state

@property
def device_class(self):
return "temperature"
Expand Down Expand Up @@ -169,7 +187,7 @@ def __init__(self, wattsClient: WattsApi, smartHome: str, id: str):
self.client = wattsClient
self.smartHome = smartHome
self.id = id
self._name = "watts_vision_target_temperature"
self._name = "Target temperature"
self._state = None
self._available = True

Expand All @@ -178,6 +196,15 @@ def unique_id(self) -> str:
"""Return the unique ID of the sensor."""
return "target_temperature_" + self.id

@property
def name(self) -> str:
"""Return the name of the entity."""
return self._name

@property
def state(self) -> Optional[str]:
return self._state

@property
def device_class(self):
return "temperature"
Expand Down

0 comments on commit 367ed41

Please sign in to comment.