Feature request (with patch)

Posted on
Mon Dec 26, 2016 1:28 pm
kmarkley offline
Posts: 185
Joined: Nov 15, 2016

Feature request (with patch)

I think it is really handy for control pages to have short versions of timers for zone groups, not just zones. Things like time since any door was open, or any motion upstairs, etc.

I've just been patching new releases, but thought maybe I should see if it could be included for realz.

Code: Select all
diff -wurN DSC Alarm.indigoPlugin/Contents/Server Plugin/Devices.xml
--- DSC Alarm.indigoPlugin/Contents/Server Plugin/Devices.xml   2016-08-18 11:04:10.000000000 -0500
+++ DSC Alarm.indigoPlugin/Contents/Server Plugin/Devices.xml   2016-08-22 20:11:19.000000000 -0500
@@ -270,6 +270,16 @@
             <ControlPageLabel>Zone Group Timer</ControlPageLabel>
               <ControlPageLabelPrefix>Zone Group Timer is</ControlPageLabelPrefix>
          </State>         
+         <State id="AnyMemberLastChangedShort">
+            <ValueType>String</ValueType>
+            <TriggerLabel>Member Changed Short State Changed</TriggerLabel>
+            <ControlPageLabel>Member Changed Short State</ControlPageLabel>
+         </State>         
+         <State id="EntireGroupLastChangedShort">
+            <ValueType>String</ValueType>
+            <TriggerLabel>Group Changed Short State Changed</TriggerLabel>
+            <ControlPageLabel>Group Changed Short State</ControlPageLabel>
+         </State>         
       </States>
       
    </Device>
diff -wurN DSC Alarm.indigoPlugin/Contents/Server Plugin/plugin.py DSC Alarm.indigoPlugin/Contents/Server Plugin/plugin.py
--- DSC Alarm.indigoPlugin/Contents/Server Plugin/plugin.py   2016-08-18 11:04:10.000000000 -0500
+++ DSC Alarm.indigoPlugin/Contents/Server Plugin/plugin.py   2016-08-22 20:21:26.000000000 -0500
@@ -1577,6 +1577,7 @@
       zoneGrp = indigo.devices[zoneGroupDevId]
 
       zoneGrp.updateStateOnServer(key=u"AnyMemberLastChangedTimer", value=0)
+      zoneGrp.updateStateOnServer(key=u"AnyMemberLastChangedShort", value="0m")
 
       newState = kZoneGroupStateClosed
       for zoneId in self.zoneGroupList[zoneGroupDevId]:
@@ -1589,6 +1590,7 @@
 
       if zoneGrp.states[u'state'] != newState:
          zoneGrp.updateStateOnServer(key=u"EntireGroupLastChangedTimer", value=0)
+         zoneGrp.updateStateOnServer(key=u"EntireGroupLastChangedShort", value="0m")
          zoneGrp.updateStateOnServer(key=u"state", value=newState)
 
 
@@ -2047,8 +2049,10 @@
                zoneGroupDevice = indigo.devices[zoneGroupDeviceId]
                tmr = zoneGroupDevice.states[u"AnyMemberLastChangedTimer"] + 1
                zoneGroupDevice.updateStateOnServer(key=u"AnyMemberLastChangedTimer", value=tmr)
+               zoneGroupDevice.updateStateOnServer(key=u"AnyMemberLastChangedShort", value=self.getShortTime(tmr))
                tmr = zoneGroupDevice.states[u"EntireGroupLastChangedTimer"] + 1
                zoneGroupDevice.updateStateOnServer(key=u"EntireGroupLastChangedTimer", value=tmr)
+               zoneGroupDevice.updateStateOnServer(key=u"EntireGroupLastChangedShort", value=self.getShortTime(tmr))
 
 
       self.closePort()

Posted on
Sun Jan 01, 2017 6:36 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

Re: Feature request (with patch)

This is a good idea. I will keep it in mind for my next update.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron