Skip to content

Commit c2eede2

Browse files
committed
Rework code comments.
1 parent 56e1b54 commit c2eede2

File tree

2 files changed

+52
-28
lines changed

2 files changed

+52
-28
lines changed

zhaquirks/bosch/rbsh_rth0_zb_eu.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,46 @@
1717
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef, ZCLCommandDef
1818

1919
"""Bosch specific thermostat attribute ids."""
20+
21+
# Mode of operation with values BoschOperatingMode.
2022
OPERATING_MODE_ATTR_ID = 0x4007
23+
24+
# Valve position: 0% - 100%
2125
VALVE_POSITION_ATTR_ID = 0x4020
26+
27+
# Window open switch (changes to a lower target temperature when on).
2228
WINDOW_OPEN_ATTR_ID = 0x4042
29+
30+
# Boost preset mode.
2331
BOOST_ATTR_ID = 0x4043
2432

2533
"""Bosch specific user interface attribute ids."""
34+
35+
# Display on-time (5s - 30s).
2636
SCREEN_TIMEOUT_ATTR_ID = 0x403A
27-
SCREEN_BRIGHTNESS_ATTR_ID = 0x403B
2837

29-
"""Bosh operating mode attribute values."""
38+
# Display brightness (0 - 10).
39+
SCREEN_BRIGHTNESS_ATTR_ID = 0x403B
3040

3141

3242
class BoschOperatingMode(t.enum8):
43+
"""Bosh operating mode attribute values."""
44+
3345
Schedule = 0x00
3446
Manual = 0x01
3547
Pause = 0x05
3648

3749

38-
"""Bosch thermostat preset."""
39-
40-
4150
class BoschPreset(t.enum8):
51+
"""Bosch thermostat preset."""
52+
4253
Normal = 0x00
4354
Boost = 0x01
4455

4556

46-
"""Binary attribute (window open) value."""
47-
48-
4957
class State(t.enum8):
58+
"""Binary attribute (window open) value."""
59+
5060
Off = 0x00
5161
On = 0x01
5262

@@ -129,7 +139,7 @@ class BoschThermostat(CustomDeviceV2):
129139
BoschThermostatCluster.cluster_id,
130140
translation_key="window_detection",
131141
)
132-
# Display time-out
142+
# Display time-out.
133143
.number(
134144
BoschUserInterfaceCluster.AttributeDefs.display_ontime.name,
135145
BoschUserInterfaceCluster.cluster_id,
@@ -138,7 +148,7 @@ class BoschThermostat(CustomDeviceV2):
138148
step=1,
139149
translation_key="on_off_transition_time",
140150
)
141-
# Display brightness
151+
# Display brightness.
142152
.number(
143153
BoschUserInterfaceCluster.AttributeDefs.display_brightness.name,
144154
BoschUserInterfaceCluster.cluster_id,

zhaquirks/bosch/rbsh_trv0_zb_eu.py

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,69 @@
1717
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef, ZCLCommandDef
1818

1919
"""Bosch specific thermostat attribute ids."""
20+
21+
# Mode of operation with values BoschOperatingMode.
2022
OPERATING_MODE_ATTR_ID = 0x4007
23+
24+
# Valve position: 0% - 100%
2125
VALVE_POSITION_ATTR_ID = 0x4020
26+
27+
# Remote measured temperature.
2228
REMOTE_TEMPERATURE_ATTR_ID = 0x4040
29+
30+
# Window open switch (changes to a lower target temperature when on).
2331
WINDOW_OPEN_ATTR_ID = 0x4042
32+
33+
# Boost preset mode.
2434
BOOST_ATTR_ID = 0x4043
2535

2636
"""Bosch specific user interface attribute ids."""
37+
38+
# Display orientation with values BoschDisplayOrientation.
2739
SCREEN_ORIENTATION_ATTR_ID = 0x400B
40+
41+
# Displayed temperature with values BoschDisplayedTemperature.
2842
DISPLAY_MODE_ATTR_ID = 0x4039
43+
44+
# Display on-time (5s - 30s).
2945
SCREEN_TIMEOUT_ATTR_ID = 0x403A
30-
SCREEN_BRIGHTNESS_ATTR_ID = 0x403B
3146

32-
"""Bosh operating mode attribute values."""
47+
# Display brightness (0 - 10).
48+
SCREEN_BRIGHTNESS_ATTR_ID = 0x403B
3349

3450

3551
class BoschOperatingMode(t.enum8):
52+
"""Bosh operating mode attribute values."""
53+
3654
Schedule = 0x00
3755
Manual = 0x01
3856
Pause = 0x05
3957

4058

41-
"""Bosch thermostat preset."""
42-
43-
4459
class BoschPreset(t.enum8):
60+
"""Bosch thermostat preset."""
61+
4562
Normal = 0x00
4663
Boost = 0x01
4764

4865

49-
"""Binary attribute (window open) value."""
50-
51-
5266
class State(t.enum8):
67+
"""Binary attribute (window open) value."""
68+
5369
Off = 0x00
5470
On = 0x01
5571

5672

57-
"""Bosch display orientation attribute values."""
58-
59-
6073
class BoschDisplayOrientation(t.enum8):
74+
"""Bosch display orientation attribute values."""
75+
6176
Normal = 0x00
6277
Flipped = 0x01
6378

6479

65-
"""Bosch displayed temperature attribute values."""
66-
67-
6880
class BoschDisplayedTemperature(t.enum8):
81+
"""Bosch displayed temperature attribute values."""
82+
6983
Target = 0x00
7084
Measured = 0x01
7185

@@ -342,7 +356,7 @@ class BoschThermostat(CustomDeviceV2):
342356
BoschThermostatCluster.cluster_id,
343357
translation_key="window_detection",
344358
)
345-
# Remote temperature
359+
# Remote temperature.
346360
.number(
347361
BoschThermostatCluster.AttributeDefs.remote_temperature.name,
348362
BoschThermostatCluster.cluster_id,
@@ -360,14 +374,14 @@ class BoschThermostat(CustomDeviceV2):
360374
BoschUserInterfaceCluster.cluster_id,
361375
translation_key="device_temperature",
362376
)
363-
# Display orientation
377+
# Display orientation.
364378
.enum(
365379
BoschUserInterfaceCluster.AttributeDefs.display_orientation.name,
366380
BoschDisplayOrientation,
367381
BoschUserInterfaceCluster.cluster_id,
368382
translation_key="inverted",
369383
)
370-
# Display time-out
384+
# Display time-out.
371385
.number(
372386
BoschUserInterfaceCluster.AttributeDefs.display_ontime.name,
373387
BoschUserInterfaceCluster.cluster_id,
@@ -376,7 +390,7 @@ class BoschThermostat(CustomDeviceV2):
376390
step=1,
377391
translation_key="on_off_transition_time",
378392
)
379-
# Display brightness
393+
# Display brightness.
380394
.number(
381395
BoschUserInterfaceCluster.AttributeDefs.display_brightness.name,
382396
BoschUserInterfaceCluster.cluster_id,

0 commit comments

Comments
 (0)