Skip to content

Commit

Permalink
Support up to 16 shutters in discovery
Browse files Browse the repository at this point in the history
Tasmota added support for more shutters recently: arendst/Tasmota#18295

The maximum number of shutters supported are now 16 shutters on newer hardware (i.e. ESP32).
  • Loading branch information
lewurm authored May 19, 2023
1 parent c96862c commit 351be30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hatasmota/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def get_cover_entities(
shutter_entities: list[tuple[TasmotaShutterConfig | None, DiscoveryHashType]] = []
shutter_indices = []

# Tasmota supports up to 4 shutters, each shutter is assigned two consecutive relays
# Tasmota supports up to 16 shutters, each shutter is assigned two consecutive relays
for idx, value in enumerate(chain(relays, [-1])):
if idx - 1 in shutter_indices:
# This is the 2nd half of a pair, skip
Expand All @@ -356,8 +356,8 @@ def get_cover_entities(
shutter_indices = []
break

# pad / truncate the shutter index list to 4
shutter_indices = shutter_indices[:4] + [-1] * (4 - len(shutter_indices))
# pad / truncate the shutter index list to 16
shutter_indices = shutter_indices[:16] + [-1] * (16 - len(shutter_indices))

for idx, relay_idx in enumerate(shutter_indices):
entity = None
Expand Down

0 comments on commit 351be30

Please sign in to comment.