Skip to content

Commit 6b35204

Browse files
committed
Remove and update deprecated constants
1 parent f1254f7 commit 6b35204

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

custom_components/jcihitachi_tw/climate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def unique_id(self):
256256
return f"{self._thing.gateway_mac_address}_climate"
257257

258258
def calculate_supported_features(self):
259-
support_flags = ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.PRESET_MODE
259+
support_flags = ClimateEntityFeature.TURN_ON | ClimateEntityFeature.TURN_OFF | ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.PRESET_MODE
260260
if self._thing.support_code.HorizontalWindDirectionSetting != "unsupported" and \
261261
self._thing.support_code.VerticalWindDirectionSwitch != "unsupported":
262262
support_flags |= ClimateEntityFeature.SWING_MODE

custom_components/jcihitachi_tw/fan.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"""JciHitachi integration."""
22
import logging
33

4-
from homeassistant.components.fan import (SUPPORT_PRESET_MODE,
5-
SUPPORT_SET_SPEED, FanEntity)
4+
from homeassistant.components.fan import (FanEntity, FanEntityFeature)
65
from homeassistant.util.percentage import (ordered_list_item_to_percentage,
76
percentage_to_ordered_list_item)
87

@@ -108,9 +107,9 @@ def unique_id(self):
108107
def calculate_supported_features(self):
109108
support_flags = 0
110109
if self._thing.support_code.FanSpeed != "unsupported":
111-
support_flags |= SUPPORT_SET_SPEED
110+
support_flags |= FanEntityFeature.SET_SPEED
112111
if self._thing.support_code.FanSpeed & 1 == 1: # auto mode is at the first bit.
113-
support_flags |= SUPPORT_PRESET_MODE
112+
support_flags |= FanEntityFeature.PRESET_MODE
114113

115114
return support_flags
116115

0 commit comments

Comments
 (0)