Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions custom_components/ds_air/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
PLATFORMS = [
Platform.CLIMATE,
Platform.SENSOR,
Platform.WATER_HEATER,
Platform.SWITCH,
]


Expand Down
4 changes: 3 additions & 1 deletion custom_components/ds_air/ds_air_service/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .config import Config
from .ctrl_enum import EnumControl
from .dao import UNINITIALIZED_VALUE, AirCon, AirConStatus, Sensor
from .dao import UNINITIALIZED_VALUE, AirCon, AirConStatus, Sensor, HD, HDStatus
from .display import display
from .service import Service

Expand All @@ -11,6 +11,8 @@
"AirCon",
"AirConStatus",
"Sensor",
"HD",
"HDStatus",
"display",
"Service",
]
10 changes: 5 additions & 5 deletions custom_components/ds_air/ds_air_service/ctrl_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EnumCmdType(IntEnum):

# 发送指令
CONTROL = 1
STATUS_CHANGED = 2
STATUS_CHANGED = 2 #对于HD设备,是开关状态改变会出现本指令
QUERY_STATUS = 3
AIR_RECOMMENDED_INDOOR_TEMP = 4
AIR_CAPABILITY_QUERY = 6
Expand Down Expand Up @@ -136,10 +136,10 @@ class EnumCmdType(IntEnum):
VENTILATION_BIND_SENSOR = 107
ALL_SENSOR_INFO = 96
VENTILATION_FILTER_CLEAN = 10
NEW_HD_DEVICE_INFO = 12
NEW_HD_STATE_UPDATE = 13
NEW_HD_STATE_SETTING = 14
NEW_HD_NIGHT_ENERGY_SETTING = 15
HD_INFO_QUERY = 12
HD_INFO_CHANGE = 13
HD_CONTROL_BASE = 14
HD_CONTROL_OTHER = 15 #这个当前只有获取夜间节能模式这一个功能
NEW_HD_QUERY_SCENARIO_SETTING = 85
HCHO_GET_INFO = 150
HCHO_SET_INFO = 151
Expand Down
47 changes: 47 additions & 0 deletions custom_components/ds_air/ds_air_service/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,53 @@ class HD(Device):
def __init__(self):
Device.__init__(self)
self.switch: EnumSwitch
self.status: HDStatus = HDStatus()


class HDStatus:
def __init__(
self,
switch: EnumControl.Switch | None = None,
cold_lower: float | None = None,
cold_temperature: float | None = None,
cold_upper: float | None = None,
mute: EnumControl.Switch | None = None,
mute_enable: EnumControl.Switch | None = None,
night_energy_end_hour: int | None = None,
night_energy_end_minute: int | None = None,
night_energy_reduce_temp: int | None = None,
night_energy_start_hour: int | None = None,
night_energy_start_minute: int | None = None,
night_energy_switch: EnumControl.Switch | None = None,
outdoor_temp: float | None = None,
preheat: int | None = None,
switch_enable: EnumControl.Switch | None = None,
temperature_set: int | None = None,
warm_cold: int | None = None, #1为制热状态
warm_lower: float | None = None,
warm_temperature: float | None = None,
warm_upper: float | None = None,
):
self.switch: EnumControl.Switch | None = switch
self.cold_lower: float | None = cold_lower
self.cold_temperature: float | None = cold_temperature
self.cold_upper: float | None = cold_upper
self.mute: EnumControl.Switch | None = mute
self.mute_enable: EnumControl.Switch | None = mute_enable
self.night_energy_end_hour: int | None = night_energy_end_hour
self.night_energy_end_minute: int | None = night_energy_end_minute
self.night_energy_reduce_temp: int | None = night_energy_reduce_temp
self.night_energy_start_hour: int | None = night_energy_start_hour
self.night_energy_start_minute: int | None = night_energy_start_minute
self.night_energy_switch: EnumControl.Switch | None = night_energy_switch
self.outdoor_temp: float | None = outdoor_temp
self.preheat: int | None = preheat
self.switch_enable: EnumControl.Switch | None = switch_enable
self.temperature_set: int | None = temperature_set
self.warm_cold: int | None = warm_cold
self.warm_lower: float | None = warm_lower
self.warm_temperature: float | None = warm_temperature
self.warm_upper: float | None = warm_upper


STATUS_ATTR = [
Expand Down
Loading