Skip to content

Commit 3aff8cf

Browse files
authored
Merge pull request #63 from claudegel/turn-0n-0ff
Add service turn_0n, trun_ 0ff
2 parents 9d0bc74 + e495c19 commit 3aff8cf

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

custom_components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sinope": {
3-
"version": "1.6.5",
3+
"version": "1.6.6",
44
"local_location": "/custom_components/sinope/__init__.py",
55
"remote_location": "https://github.com/claudegel/sinope-gt125/tree/master/custom_components/__init__.py",
66
"visit_repo": "https://github.com/claudegel/sinope-gt125",

custom_components/sinope/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#REQUIREMENTS = ['PY_Sinope==0.1.7']
4545
REQUIREMENTS = ['crc8==0.1.0']
46-
VERSION = '1.6.5'
46+
VERSION = '1.6.6'
4747

4848
DATA_DOMAIN = 'data_' + DOMAIN
4949

custom_components/sinope/climate.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,15 @@
8989

9090
_LOGGER = logging.getLogger(__name__)
9191

92-
SUPPORT_FLAGS = (ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE | SUPPORT_OUTSIDE_TEMPERATURE | SUPPORT_KEYPAD_LOCK | SUPPORT_SECOND_DISPLAY)
92+
SUPPORT_FLAGS = (
93+
ClimateEntityFeature.TARGET_TEMPERATURE
94+
| ClimateEntityFeature.PRESET_MODE
95+
| ClimateEntityFeature.TURN_OFF
96+
| ClimateEntityFeature.TURN_ON
97+
| SUPPORT_OUTSIDE_TEMPERATURE
98+
| SUPPORT_KEYPAD_LOCK
99+
| SUPPORT_SECOND_DISPLAY
100+
)
93101

94102
DEFAULT_NAME = "sinope"
95103
DATA_DOMAIN = 'data_' + DOMAIN
@@ -390,6 +398,9 @@ def set_climate_basic_data_service(service):
390398
class SinopeThermostat(ClimateEntity):
391399
"""Implementation of a Sinope thermostat."""
392400

401+
_enable_turn_on_off_backwards_compatibility = False
402+
_attr_temperature_unit = UnitOfTemperature.CELSIUS
403+
393404
def __init__(self, data, device_id, name, device_type, server):
394405
"""Initialize."""
395406
self._name = name
@@ -610,6 +621,23 @@ def hvac_action(self):
610621
else:
611622
return HVACAction.HEATING
612623

624+
@property
625+
def is_on(self):
626+
"""Return True if mode = HVACMode.HEAT or HVACMode.AUTO."""
627+
if self._operation_mode == SINOPE_MODE_MANUAL or self._operation_mode == SINOPE_MODE_AUTO or self._operation_mode == SINOPE_MODE_AWAY:
628+
return True
629+
return False
630+
631+
def turn_on(self):
632+
"""Turn the thermostat to HVACMode.heat."""
633+
self._client.set_mode(self._server, self._id, self._type, SINOPE_MODE_AUTO)
634+
self._operation_mode = SINOPE_MODE_AUTO
635+
636+
def turn_off(self):
637+
"""Turn the thermostat to HVACMode.off."""
638+
self._client.set_mode(self._server, self._id, self._type, SINOPE_MODE_OFF)
639+
self._operation_mode = SINOPE_MODE_OFF
640+
613641
def set_temperature(self, **kwargs):
614642
"""Set new target temperature."""
615643
temperature = kwargs.get(ATTR_TEMPERATURE)

custom_components/sinope/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"dependencies": [],
66
"codeowners": ["@claudegel"],
77
"requirements": ["crc8==0.1.0"],
8-
"version": "1.6.5"
8+
"version": "1.6.6"
99
}

0 commit comments

Comments
 (0)