mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-26 15:21:41 +01:00
[hydrawise] Support unused zones (#12275)
* [hydrawise] Support unused zones Fixes #12209 Signed-off-by: Dan Cunningham <dan@digitaldan.com>
This commit is contained in:
parent
a7e6fe648d
commit
b7e064a872
@ -274,9 +274,15 @@ public class HydrawiseControllerHandler extends BaseThingHandler implements Hydr
|
|||||||
private void updateZones(List<Zone> zones) {
|
private void updateZones(List<Zone> zones) {
|
||||||
AtomicReference<Boolean> anyRunning = new AtomicReference<Boolean>(false);
|
AtomicReference<Boolean> anyRunning = new AtomicReference<Boolean>(false);
|
||||||
AtomicReference<Boolean> anySuspended = new AtomicReference<Boolean>(false);
|
AtomicReference<Boolean> anySuspended = new AtomicReference<Boolean>(false);
|
||||||
int i = 1;
|
|
||||||
for (Zone zone : zones) {
|
for (Zone zone : zones) {
|
||||||
String group = "zone" + (i++);
|
// there are 12 relays per expander, expanders will have a zoneNumber like:
|
||||||
|
// 10 for expander 0, relay 10 = zone10
|
||||||
|
// 101 for expander 1, relay 1 = zone13
|
||||||
|
// 212 for expander 2, relay 12 = zone36
|
||||||
|
// division of integers in Java give whole numbers, not remainders FYI
|
||||||
|
int zoneNumber = ((zone.number.value / 100) * 12) + (zone.number.value % 100);
|
||||||
|
|
||||||
|
String group = "zone" + zoneNumber;
|
||||||
zoneMaps.put(group, zone);
|
zoneMaps.put(group, zone);
|
||||||
logger.trace("Updateing Zone {} {} ", group, zone.name);
|
logger.trace("Updateing Zone {} {} ", group, zone.name);
|
||||||
updateGroupState(group, CHANNEL_ZONE_NAME, new StringType(zone.name));
|
updateGroupState(group, CHANNEL_ZONE_NAME, new StringType(zone.name));
|
||||||
|
Loading…
Reference in New Issue
Block a user