Skip to content

Commit

Permalink
Add Pilote v4
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Dec 8, 2024
1 parent 0c255a9 commit d75830e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 11 additions & 6 deletions custom_components/heatzy/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
PILOTE_V1,
PILOTE_V2,
PILOTE_V3,
PILOTE_V4,
PRESET_COMFORT_1,
PRESET_COMFORT_2,
PRESET_PRESENCE_DETECT,
Expand Down Expand Up @@ -129,7 +130,7 @@ class HeatzyClimateEntityDescription(ClimateEntityDescription):
HeatzyClimateEntityDescription(
key="pilote_v2",
translation_key="pilote_v2",
products=PILOTE_V2,
products=PILOTE_V2 + PILOTE_V3,
preset_modes=[
PRESET_COMFORT,
PRESET_ECO,
Expand All @@ -152,9 +153,9 @@ class HeatzyClimateEntityDescription(ClimateEntityDescription):
},
),
HeatzyClimateEntityDescription(
key="pilote_v3",
translation_key="pilote_v3",
products=PILOTE_V3,
key="pilote_v4",
translation_key="pilote_v4",
products=PILOTE_V4,
fn=lambda x, y, z: HeatzyPiloteV3Thermostat(x, y, z),
preset_modes=[
PRESET_COMFORT,
Expand Down Expand Up @@ -204,12 +205,16 @@ class HeatzyClimateEntityDescription(ClimateEntityDescription):
"cft": PRESET_COMFORT,
"eco": PRESET_ECO,
"fro": PRESET_AWAY,
"cft1": PRESET_COMFORT_1,
"cft2": PRESET_COMFORT_2,
"stop": PRESET_NONE,
},
ha_to_heatzy_state={
PRESET_COMFORT: "cft",
PRESET_ECO: "eco",
PRESET_AWAY: "fro",
PRESET_COMFORT_1: "cft1",
PRESET_COMFORT_2: "cft2",
PRESET_NONE: "stop",
},
temperature_high=CFT_TEMP_H,
Expand Down Expand Up @@ -515,8 +520,8 @@ def current_temperature(self) -> float:
@property
def target_temperature_high(self) -> float:
"""Return comfort temperature."""
cft_tempL = self._attrs.get(self.entity_description.temperature_high, 0)
cft_tempH = self._attrs.get(self.entity_description.temperature_low, 0)
cft_tempH = self._attrs.get(self.entity_description.temperature_high, 0)
cft_tempL = self._attrs.get(self.entity_description.temperature_low, 0)

return (cft_tempL + (cft_tempH * 256)) / 10

Expand Down
4 changes: 3 additions & 1 deletion custom_components/heatzy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@
PILOTE_V2 = [
"51d16c22a5f74280bc3cfe9ebcdc6402", # PILOTE2
"4fc968a21e7243b390e9ede6f1c6465d", # PILOTE2_ELEC_PRO
]
PILOTE_V3 = [
"b9a67b6ce24b437d9794103fd317e627", # PILOTE_SOC
"b8c6657b66c34148b4dee64d615cefc7", # ELEC_PRO_SOC
]
PILOTE_V3 = [
PILOTE_V4 = [
"9dacde7ef459421eaf8dc4bea9385634", # ELEC_PRO_BLE
"46409c7f29d4411c85a3a46e5ee3703e", # Sauter PILOTE_SOC_C3
]
Expand Down

0 comments on commit d75830e

Please sign in to comment.