plugwise 0.37.1__py3-none-any.whl → 0.37.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
plugwise/constants.py CHANGED
@@ -121,21 +121,20 @@ P1_LEGACY_MEASUREMENTS: Final[dict[str, UOM]] = {
121
121
  # radiator_valve: 'uncorrected_temperature', 'temperature_offset'
122
122
 
123
123
  DEVICE_MEASUREMENTS: Final[dict[str, DATA | UOM]] = {
124
- # HA Core thermostat current_temperature
125
- "temperature": UOM(TEMP_CELSIUS),
126
- # HA Core thermostat setpoint
127
- "thermostat": DATA("setpoint", TEMP_CELSIUS),
128
- # Specific for an Anna
129
- "illuminance": UOM(UNIT_LUMEN),
124
+ "humidity": UOM(PERCENTAGE), # Specific for a Jip
125
+ "illuminance": UOM(UNIT_LUMEN), # Specific for an Anna
126
+ "temperature": UOM(TEMP_CELSIUS), # HA Core thermostat current_temperature
127
+ "thermostat": DATA("setpoint", TEMP_CELSIUS), # HA Core thermostat setpoint
128
+ ########################################################
130
129
  # Specific for an Anna with heatpump extension installed
131
130
  "cooling_activation_outdoor_temperature": UOM(TEMP_CELSIUS),
132
131
  "cooling_deactivation_threshold": UOM(TEMP_CELSIUS),
133
- # Specific for a Lisa a Tom/Floor
132
+ ##################################
133
+ # Specific for a Lisa or Tom/Floor
134
134
  "battery": UOM(PERCENTAGE),
135
135
  "temperature_difference": UOM(DEGREE),
136
136
  "valve_position": UOM(PERCENTAGE),
137
- # Specific for a Jip
138
- "humidity": UOM(PERCENTAGE),
137
+ #####################
139
138
  # Specific for a Plug
140
139
  "electricity_consumed": UOM(POWER_WATT),
141
140
  "electricity_produced": UOM(POWER_WATT),
@@ -144,39 +143,43 @@ DEVICE_MEASUREMENTS: Final[dict[str, DATA | UOM]] = {
144
143
 
145
144
  # Heater Central related measurements
146
145
  HEATER_CENTRAL_MEASUREMENTS: Final[dict[str, DATA | UOM]] = {
146
+ "boiler_state": DATA(
147
+ "flame_state", NONE
148
+ ), # Legacy Anna: similar to flame-state on Anna/Adam
147
149
  "boiler_temperature": DATA("water_temperature", TEMP_CELSIUS),
150
+ "central_heating_state": DATA(
151
+ "c_heating_state", NONE
152
+ ), # For Elga (heatpump) use this instead of intended_central_heating_state
153
+ "central_heater_water_pressure": DATA("water_pressure", PRESSURE_BAR),
154
+ "compressor_state": UOM(NONE), # present with heatpump
155
+ "cooling_enabled": UOM(
156
+ NONE
157
+ ), # Available with the Loria and Elga (newer Anna firmware) heatpumps
158
+ "cooling_state": UOM(NONE),
148
159
  "domestic_hot_water_mode": DATA("select_dhw_mode", NONE),
149
160
  "domestic_hot_water_setpoint": UOM(TEMP_CELSIUS),
150
161
  "domestic_hot_water_state": DATA("dhw_state", NONE),
151
162
  "domestic_hot_water_temperature": DATA("dhw_temperature", TEMP_CELSIUS),
152
163
  "elga_status_code": UOM(NONE),
164
+ "intended_boiler_state": DATA(
165
+ "heating_state", NONE
166
+ ), # Legacy Anna: shows when heating is active, we don't show dhw_state, cannot be determined reliably
167
+ "flame_state": UOM(
168
+ NONE
169
+ ), # Also present when there is a single gas-heater
153
170
  "intended_boiler_temperature": UOM(
154
171
  TEMP_CELSIUS
155
172
  ), # Non-zero when heating, zero when dhw-heating
156
- "central_heating_state": DATA(
157
- "c_heating_state", NONE
158
- ), # For Elga (heatpump) use this instead of intended_central_heating_state
159
173
  "intended_central_heating_state": DATA(
160
174
  "heating_state", NONE
161
175
  ), # This key shows in general the heating-behavior better than c-h_state. except when connected to a heatpump
162
176
  "modulation_level": UOM(PERCENTAGE),
163
177
  "return_water_temperature": DATA("return_temperature", TEMP_CELSIUS),
164
- # Used with the Elga heatpump - marcelveldt
165
- "compressor_state": UOM(NONE),
166
- "cooling_state": UOM(NONE),
167
- "thermostat_supports_cooling": UOM(NONE),
168
- # Available with the Loria and Elga (newer Anna firmware) heatpumps
169
- "cooling_enabled": UOM(NONE),
170
- # Next 2 keys are used to show the state of the gas-heater used next to the Elga heatpump - marcelveldt
171
- "slave_boiler_state": UOM(NONE),
172
- "flame_state": UOM(NONE), # Also present when there is a single gas-heater
173
- "central_heater_water_pressure": DATA("water_pressure", PRESSURE_BAR),
174
- # Legacy Anna: similar to flame-state on Anna/Adam
175
- "boiler_state": DATA("flame_state", NONE),
176
- # Legacy Anna: shows when heating is active, we don't show dhw_state, cannot be determined reliably
177
- "intended_boiler_state": DATA("heating_state", NONE),
178
- # Outdoor temperature from APPLIANCES - present for a heatpump
179
- "outdoor_temperature": DATA("outdoor_air_temperature", TEMP_CELSIUS),
178
+ "outdoor_temperature": DATA(
179
+ "outdoor_air_temperature", TEMP_CELSIUS
180
+ ), # Outdoor temperature from APPLIANCES - present for a heatpump
181
+ "slave_boiler_state": DATA("secondary_boiler_state", NONE),
182
+ "thermostat_supports_cooling": UOM(NONE), # present with heatpump
180
183
  }
181
184
 
182
185
  OBSOLETE_MEASUREMENTS: Final[tuple[str, ...]] = (
@@ -253,22 +256,22 @@ ApplianceType = Literal[
253
256
  ]
254
257
 
255
258
  BinarySensorType = Literal[
256
- "cooling_enabled",
257
259
  "compressor_state",
260
+ "cooling_enabled",
258
261
  "cooling_state",
259
262
  "dhw_state",
260
263
  "flame_state",
261
264
  "heating_state",
262
265
  "plugwise_notification",
263
- "slave_boiler_state",
266
+ "secondary_boiler_state",
264
267
  ]
265
268
  BINARY_SENSORS: Final[tuple[str, ...]] = get_args(BinarySensorType)
266
269
 
267
270
  LIMITS: Final[tuple[str, ...]] = (
271
+ "lower_bound",
268
272
  "offset",
269
- "setpoint",
270
273
  "resolution",
271
- "lower_bound",
274
+ "setpoint",
272
275
  "upper_bound",
273
276
  )
274
277
 
@@ -329,8 +332,8 @@ SENSORS: Final[tuple[str, ...]] = get_args(SensorType)
329
332
 
330
333
  SPECIAL_PLUG_TYPES: Final[tuple[str, ...]] = (
331
334
  "central_heating_pump",
332
- "valve_actuator",
333
335
  "heater_electric",
336
+ "valve_actuator",
334
337
  )
335
338
 
336
339
  SpecialType = Literal[
@@ -350,14 +353,14 @@ SwitchType = Literal[
350
353
  ]
351
354
  SWITCHES: Final[tuple[str, ...]] = get_args(SwitchType)
352
355
 
353
- SWITCH_GROUP_TYPES: Final[tuple[str, ...]] = ("switching", "report")
356
+ SWITCH_GROUP_TYPES: Final[tuple[str, ...]] = ("report", "switching")
354
357
 
355
358
  THERMOSTAT_CLASSES: Final[tuple[str, ...]] = (
356
359
  "thermostat",
360
+ "thermostatic_radiator_valve",
357
361
  "thermo_sensor",
358
362
  "zone_thermometer",
359
363
  "zone_thermostat",
360
- "thermostatic_radiator_valve",
361
364
  )
362
365
 
363
366
  ToggleNameType = Literal[
@@ -392,25 +395,25 @@ class ModelData(TypedDict):
392
395
  """The ModelData class."""
393
396
 
394
397
  contents: bool
395
- vendor_name: str | None
396
- vendor_model: str | None
397
- hardware_version: str | None
398
398
  firmware_version: str | None
399
- zigbee_mac_address: str | None
399
+ hardware_version: str | None
400
400
  reachable: bool | None
401
+ vendor_model: str | None
402
+ vendor_name: str | None
403
+ zigbee_mac_address: str | None
401
404
 
402
405
 
403
406
  class SmileBinarySensors(TypedDict, total=False):
404
407
  """Smile Binary Sensors class."""
405
408
 
406
- cooling_enabled: bool
407
409
  compressor_state: bool
410
+ cooling_enabled: bool
408
411
  cooling_state: bool
409
412
  dhw_state: bool
410
413
  flame_state: bool
411
414
  heating_state: bool
412
415
  plugwise_notification: bool
413
- slave_boiler_state: bool
416
+ secondary_boiler_state: bool
414
417
 
415
418
 
416
419
  class SmileSensors(TypedDict, total=False):
@@ -482,9 +485,9 @@ class ThermoLoc(TypedDict, total=False):
482
485
  """Thermo Location class."""
483
486
 
484
487
  name: str
485
- master: str | None
486
- master_prio: int
487
- slaves: set[str]
488
+ primary: str | None
489
+ primary_prio: int
490
+ secondary: set[str]
488
491
 
489
492
 
490
493
  class ActuatorData(TypedDict, total=False):
plugwise/data.py CHANGED
@@ -125,7 +125,7 @@ class SmileData(SmileHelper):
125
125
  self._device_data_switching_group(device, data)
126
126
  # Adam data
127
127
  self._device_data_adam(device, data)
128
- # Skip obtaining data for non master-thermostats
128
+ # Skip obtaining data for (Adam) secondary thermostats
129
129
  if device["dev_class"] not in ZONE_THERMOSTATS:
130
130
  return data
131
131
 
@@ -164,7 +164,7 @@ class SmileData(SmileHelper):
164
164
  ):
165
165
  data["binary_sensors"]["heating_state"] = self._heating_valves() != 0
166
166
 
167
- # Show the allowed regulation modes and gateway_modes
167
+ # Show the allowed regulation_modes and gateway_modes
168
168
  if device["dev_class"] == "gateway":
169
169
  if self._reg_allowed_modes:
170
170
  data["regulation_modes"] = self._reg_allowed_modes
@@ -173,7 +173,7 @@ class SmileData(SmileHelper):
173
173
  data["gateway_modes"] = self._gw_allowed_modes
174
174
  self._count += 1
175
175
 
176
- # Control_state, only for Adam master thermostats
176
+ # Control_state, only available for Adam primary thermostats
177
177
  if device["dev_class"] in ZONE_THERMOSTATS:
178
178
  loc_id = device["location"]
179
179
  if ctrl_state := self._control_state(loc_id):
plugwise/helper.py CHANGED
@@ -813,7 +813,7 @@ class SmileHelper(SmileCommon):
813
813
  """Helper-function for smile.py: get_all_devices().
814
814
 
815
815
  Update locations with thermostat ranking results and use
816
- the result to update the device_class of slave thermostats.
816
+ the result to update the device_class of secondary thermostats.
817
817
  """
818
818
  self._thermo_locs = self._match_locations()
819
819
 
@@ -828,11 +828,11 @@ class SmileHelper(SmileCommon):
828
828
  for dev_id, device in self.gw_devices.items():
829
829
  self._rank_thermostat(thermo_matching, loc_id, dev_id, device)
830
830
 
831
- # Update slave thermostat class where needed
831
+ # Update secondary thermostat class where needed
832
832
  for dev_id, device in self.gw_devices.items():
833
833
  if (loc_id := device["location"]) in self._thermo_locs:
834
834
  tl_loc_id = self._thermo_locs[loc_id]
835
- if "slaves" in tl_loc_id and dev_id in tl_loc_id["slaves"]:
835
+ if "secondary" in tl_loc_id and dev_id in tl_loc_id["secondary"]:
836
836
  device["dev_class"] = "thermo_sensor"
837
837
 
838
838
  def _match_locations(self) -> dict[str, ThermoLoc]:
@@ -845,7 +845,7 @@ class SmileHelper(SmileCommon):
845
845
  for appliance_details in self.gw_devices.values():
846
846
  if appliance_details["location"] == location_id:
847
847
  location_details.update(
848
- {"master": None, "master_prio": 0, "slaves": set()}
848
+ {"primary": None, "primary_prio": 0, "secondary": set()}
849
849
  )
850
850
  matched_locations[location_id] = location_details
851
851
 
@@ -860,29 +860,29 @@ class SmileHelper(SmileCommon):
860
860
  ) -> None:
861
861
  """Helper-function for _scan_thermostats().
862
862
 
863
- Rank the thermostat based on appliance_details: master or slave.
863
+ Rank the thermostat based on appliance_details: primary or secondary.
864
864
  """
865
865
  appl_class = appliance_details["dev_class"]
866
866
  appl_d_loc = appliance_details["location"]
867
867
  if loc_id == appl_d_loc and appl_class in thermo_matching:
868
- # Pre-elect new master
869
- if thermo_matching[appl_class] > self._thermo_locs[loc_id]["master_prio"]:
870
- # Demote former master
871
- if (tl_master := self._thermo_locs[loc_id]["master"]) is not None:
872
- self._thermo_locs[loc_id]["slaves"].add(tl_master)
868
+ # Pre-elect new primary
869
+ if thermo_matching[appl_class] > self._thermo_locs[loc_id]["primary_prio"]:
870
+ # Demote former primary
871
+ if (tl_primary:= self._thermo_locs[loc_id]["primary"]) is not None:
872
+ self._thermo_locs[loc_id]["secondary"].add(tl_primary)
873
873
 
874
- # Crown master
875
- self._thermo_locs[loc_id]["master_prio"] = thermo_matching[appl_class]
876
- self._thermo_locs[loc_id]["master"] = appliance_id
874
+ # Crown primary
875
+ self._thermo_locs[loc_id]["primary_prio"] = thermo_matching[appl_class]
876
+ self._thermo_locs[loc_id]["primary"] = appliance_id
877
877
 
878
878
  else:
879
- self._thermo_locs[loc_id]["slaves"].add(appliance_id)
879
+ self._thermo_locs[loc_id]["secondary"].add(appliance_id)
880
880
 
881
881
  def _control_state(self, loc_id: str) -> str | bool:
882
882
  """Helper-function for _device_data_adam().
883
883
 
884
884
  Adam: find the thermostat control_state of a location, from DOMAIN_OBJECTS.
885
- Represents the heating/cooling demand-state of the local master thermostat.
885
+ Represents the heating/cooling demand-state of the local primary thermostat.
886
886
  Note: heating or cooling can still be active when the setpoint has been reached.
887
887
  """
888
888
  locator = f'location[@id="{loc_id}"]'
plugwise/legacy/data.py CHANGED
@@ -6,7 +6,7 @@ from __future__ import annotations
6
6
 
7
7
  # Dict as class
8
8
  # Version detection
9
- from plugwise.constants import NONE, ZONE_THERMOSTATS, DeviceData
9
+ from plugwise.constants import NONE, DeviceData
10
10
  from plugwise.legacy.helper import SmileLegacyHelper
11
11
  from plugwise.util import remove_empty_platform_dicts
12
12
 
@@ -57,8 +57,8 @@ class SmileLegacyData(SmileLegacyHelper):
57
57
  # Switching groups data
58
58
  self._device_data_switching_group(device, data)
59
59
 
60
- # Skip obtaining data for non master-thermostats
61
- if device["dev_class"] not in ZONE_THERMOSTATS:
60
+ # Skip obtaining data when not a thermostat
61
+ if device["dev_class"] != "thermostat":
62
62
  return data
63
63
 
64
64
  # Thermostat data (presets, temperatures etc)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plugwise
3
- Version: 0.37.1
3
+ Version: 0.37.2
4
4
  Summary: Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3.
5
5
  Home-page: https://github.com/plugwise/python-plugwise
6
6
  Author: Plugwise device owners
@@ -42,11 +42,8 @@ Requires-Python: >=3.11.0
42
42
  Description-Content-Type: text/markdown
43
43
  License-File: LICENSE
44
44
  Requires-Dist: aiohttp
45
- Requires-Dist: async-timeout
46
- Requires-Dist: crcmod
47
45
  Requires-Dist: defusedxml
48
46
  Requires-Dist: munch
49
- Requires-Dist: pyserial
50
47
  Requires-Dist: python-dateutil
51
48
 
52
49
  # Plugwise python module
@@ -1,17 +1,17 @@
1
1
  plugwise/__init__.py,sha256=A0XCK9xmhzLGSsy0bAGr2tnKfGDUlJ7WzQfeIqCCd8A,14004
2
2
  plugwise/common.py,sha256=P4sUYzgVcFsIR2DmQxeVeOiZvFZWpZXgwHA3XRc1Sx0,12538
3
- plugwise/constants.py,sha256=_IO-MQQu_gFZ71VTNlmNY5Lqr6u0t5rWaQTQJqe_xRc,16467
4
- plugwise/data.py,sha256=cjTBglHJ984DYm13KAk0wFiDBqZZdNpdyEURuvmiuvc,8948
3
+ plugwise/constants.py,sha256=adi2UFHJUcPRWNz1bn155NC9DLzhYbeNriMKTpSyWAg,16574
4
+ plugwise/data.py,sha256=OTkPJ80b1L1h_TeddfvmUPX1-jBacTjbHKD0XgUIfeg,8965
5
5
  plugwise/exceptions.py,sha256=rymGtWnXosdFkzSehc_41HVl2jXJEg_9Hq9APDEUwrk,1223
6
- plugwise/helper.py,sha256=Hby_y2VsCubW8AmBWDQ_QmoL8rQCx9-V4BNRfLXWPpk,43998
6
+ plugwise/helper.py,sha256=bNT_Tdc0LAxmVZEikMgKm461jeGP-WY-cI1r3JGgIcI,44037
7
7
  plugwise/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  plugwise/smile.py,sha256=_1VFG81pfuy673M8kGQVfpSX3Kdin2Xl7-KsUXNpGlY,16985
9
9
  plugwise/util.py,sha256=w24CiW-xSV3ARZAeNYZ9T5C4kJpYGCcBoIlX2BhNOYg,6618
10
- plugwise/legacy/data.py,sha256=z8CkqpV_qL4QKeSvv0Z589Ub9OV_DOlBpM6YHzvKhIg,3017
10
+ plugwise/legacy/data.py,sha256=y7gBG9Sg40lltB3B5CpWPtAXggMbcx2IMay-mwvOB1M,2986
11
11
  plugwise/legacy/helper.py,sha256=tSrqA2UeMO7HSYudQHAxBThBTevAOKIxHqN6NCN-r5k,18947
12
12
  plugwise/legacy/smile.py,sha256=_oyI7zZhqT9Vced8jHQxN-eWIiaR4xuWKAxEBDQVfF4,10238
13
- plugwise-0.37.1.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
14
- plugwise-0.37.1.dist-info/METADATA,sha256=E8hwsvJFtyGB3tH6hnT7vYdC_3PtSgQ6Aw3bwFDzb94,9065
15
- plugwise-0.37.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
16
- plugwise-0.37.1.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
17
- plugwise-0.37.1.dist-info/RECORD,,
13
+ plugwise-0.37.2.dist-info/LICENSE,sha256=mL22BjmXtg_wnoDnnaqps5_Bg_VGj_yHueX5lsKwbCc,1144
14
+ plugwise-0.37.2.dist-info/METADATA,sha256=YlNRTSOSaB8X-lZ0pdEun3q3Z2aEzO82NOgYqOQgDgQ,8990
15
+ plugwise-0.37.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
16
+ plugwise-0.37.2.dist-info/top_level.txt,sha256=MYOmktMFf8ZmX6_OE1y9MoCZFfY-L8DA0F2tA2IvE4s,9
17
+ plugwise-0.37.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5