Skip to content

Commit

Permalink
Merge pull request #48 from Necroneco/climate
Browse files Browse the repository at this point in the history
Add climate support
  • Loading branch information
rxwen authored Nov 3, 2023
2 parents 3908330 + d13112d commit f64d7a2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
9 changes: 5 additions & 4 deletions custom_components/terncy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@
PROFILE_YAN_BUTTON = 6
PROFILE_SMART_DIAL = 7
PROFILE_COLOR_LIGHT = 8

PROFILE_11_LOCK = 11 # lockState, battery
# PROFILE_9 = 9 # 中央空调控制器
PROFILE_AC_UNIT_MACHINE = 10 # 中央空调分机
PROFILE_LOCK = 11 # lockState, battery
PROFILE_EXTENDED_COLOR_LIGHT = 12
PROFILE_COLOR_TEMPERATURE_LIGHT = 13

PROFILE_HA_TEMPERATURE_HUMIDITY = 15
# PROFILE_16 = 16 # todo volume, playState, mute
PROFILE_DIMMABLE_COLOR_TEMPERATURE_LIGHT = 17
PROFILE_18 = 18 # motion, [battery, motionL, motionR]
PROFILE_OCCUPANCY_SENSOR = 18 # motion, [battery, motionL, motionR]
PROFILE_DIMMABLE_LIGHT = 19
PROFILE_DIMMABLE_LIGHT2 = 20
# PROFILE_21 = 21 # todo SM0202 iasZoneStatus, battery
PROFILE_24_GAS = 24 # iasZoneStatus
PROFILE_GAS = 24 # iasZoneStatus
PROFILE_COLOR_DIMMABLE_LIGHT = 26
PROFILE_EXTENDED_COLOR_LIGHT2 = 27

Expand Down
19 changes: 13 additions & 6 deletions custom_components/terncy/profiles/before_2023_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
from homeassistant.helpers.entity import EntityCategory # <2023.3

from ..binary_sensor import TerncyBinarySensorDescription
from ..climate import TerncyClimateDescription
from ..const import (
PROFILE_11_LOCK,
PROFILE_18,
PROFILE_24_GAS,
PROFILE_AC_UNIT_MACHINE,
PROFILE_COLOR_DIMMABLE_LIGHT,
PROFILE_COLOR_LIGHT,
PROFILE_COLOR_TEMPERATURE_LIGHT,
Expand All @@ -20,7 +19,10 @@
PROFILE_DOOR_SENSOR,
PROFILE_EXTENDED_COLOR_LIGHT,
PROFILE_EXTENDED_COLOR_LIGHT2,
PROFILE_GAS,
PROFILE_HA_TEMPERATURE_HUMIDITY,
PROFILE_LOCK,
PROFILE_OCCUPANCY_SENSOR,
PROFILE_ONOFF_LIGHT,
PROFILE_PIR,
PROFILE_PLUG,
Expand Down Expand Up @@ -148,7 +150,12 @@
supported_color_modes={ColorMode.HS},
),
],
PROFILE_11_LOCK: [
PROFILE_AC_UNIT_MACHINE: [
TerncyClimateDescription(
key="climate",
),
],
PROFILE_LOCK: [
TerncyBinarySensorDescription(
key="lock",
device_class=BinarySensorDeviceClass.LOCK,
Expand Down Expand Up @@ -181,7 +188,7 @@
supported_color_modes={ColorMode.COLOR_TEMP},
),
],
PROFILE_18: [
PROFILE_OCCUPANCY_SENSOR: [
TerncyBinarySensorDescription(
key="motion",
sub_key="motion",
Expand Down Expand Up @@ -221,7 +228,7 @@
supported_color_modes={ColorMode.BRIGHTNESS},
),
],
PROFILE_24_GAS: [
PROFILE_GAS: [
TerncyBinarySensorDescription(
key="gas",
sub_key="gas",
Expand Down
19 changes: 13 additions & 6 deletions custom_components/terncy/profiles/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
from homeassistant.const import EntityCategory

from ..binary_sensor import TerncyBinarySensorDescription
from ..climate import TerncyClimateDescription
from ..const import (
EVENT_ENTITY_BUTTON_EVENTS,
EVENT_ENTITY_DIAL_EVENTS,
HAS_EVENT_PLATFORM,
PROFILE_11_LOCK,
PROFILE_18,
PROFILE_24_GAS,
PROFILE_AC_UNIT_MACHINE,
PROFILE_COLOR_DIMMABLE_LIGHT,
PROFILE_COLOR_LIGHT,
PROFILE_COLOR_TEMPERATURE_LIGHT,
Expand All @@ -23,7 +22,10 @@
PROFILE_DOOR_SENSOR,
PROFILE_EXTENDED_COLOR_LIGHT,
PROFILE_EXTENDED_COLOR_LIGHT2,
PROFILE_GAS,
PROFILE_HA_TEMPERATURE_HUMIDITY,
PROFILE_LOCK,
PROFILE_OCCUPANCY_SENSOR,
PROFILE_ONOFF_LIGHT,
PROFILE_PIR,
PROFILE_PLUG,
Expand Down Expand Up @@ -156,7 +158,12 @@
supported_color_modes={ColorMode.HS},
),
],
PROFILE_11_LOCK: [
PROFILE_AC_UNIT_MACHINE: [
TerncyClimateDescription(
key="climate",
),
],
PROFILE_LOCK: [
TerncyBinarySensorDescription(
key="lock",
device_class=BinarySensorDeviceClass.LOCK,
Expand Down Expand Up @@ -189,7 +196,7 @@
supported_color_modes={ColorMode.COLOR_TEMP},
),
],
PROFILE_18: [
PROFILE_OCCUPANCY_SENSOR: [
TerncyBinarySensorDescription(
key="motion",
sub_key="motion",
Expand Down Expand Up @@ -228,7 +235,7 @@
supported_color_modes={ColorMode.BRIGHTNESS},
),
],
PROFILE_24_GAS: [
PROFILE_GAS: [
TerncyBinarySensorDescription(
key="gas",
sub_key="gas",
Expand Down

0 comments on commit f64d7a2

Please sign in to comment.