Skip to content

Commit 8cc4be8

Browse files
Colorado Four WheelerColorado Four Wheeler
authored andcommitted
1.0.0-rc1
* Final fixes for SenseMe fan/light support ([Issue #97](#97)) * Adjusted acceptable value range on Heat and Cooling set points to allow for wider changes ([Issue #97](#97)) * Added automatic server restart if the Homebridge debug option is changed * Removed Simulated Device Dump from plugin actions (still remains in device actions) in Advanced Plugin Actions menu since the recent changes have rendered that somewhat inoperable * Removed 'use new library' option from plugin config until needed again * Removed 'performance options' from plugin menu as it is no longer needed * Removed 'development testing' from plugin menu in preparation for release * Changed Homebridge debug checkbox in the server advanced options to a combobox that will allow the user to debug Homebridge-Indigo, Homebridge server, neither or both to allow for a full comprehensive debug if there are issues that require seeing what Homebridge is doing * Changed server device re-caching to only happen when the included devices or actions are changed in a server rather than on any properly or attribute change * [Issue #99](#99) resolved * [Issue #97](#97) resolved
1 parent c013025 commit 8cc4be8

10 files changed

Lines changed: 180 additions & 115 deletions

File tree

.github/ISSUE_TEMPLATE.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!-- Provide a general summary in the Title above -->
2+
3+
<!-- If you are having multiple issues please open multiple tickets instead of trying to cram it all into a single ticket since some issue may take longer than others to resolve. -->
4+
5+
### Expected Behavior
6+
<!-- If you're describing a bug, tell us what should happen -->
7+
<!-- If you're suggesting a change/improvement, tell us how it should work -->
8+
9+
### Current Behavior
10+
<!-- If describing a bug, tell us what happens instead of the expected behavior -->
11+
<!-- If suggesting a change/improvement, explain the difference from current behavior -->
12+
13+
### Steps to Reproduce (for bugs)
14+
<!-- Please add a series of steps to reproduce the problem. -->
15+
16+
### Versions
17+
<!-- Please provide the version of the plugin you are running (found in the Plugins menu under HomeKit Bridge). -->
18+
- **Plugin**: `YourVersion`
19+
20+
### Configuration
21+
<!-- If relevant, include the contents of your config.json file between the two ``` lines below.
22+
- Retrieve the configuration for your server:
23+
- Open the Indigo Plugins menu
24+
- Select HomeKit Bridge
25+
- Select Advanced Plugin Actions
26+
- Select the server having issues in the first Device field
27+
- Select `Show Homebridge Configuration` from Device Actions
28+
- Click the `Execute Action` button
29+
- Copy contents of the log from your Indigo Event Log window
30+
- Remove any sensitive information, passwords, etc.
31+
- If output is long please extract only the relevant portions if possible
32+
-->
33+
```json
34+
35+
```
36+
37+
### Homebridge Log / Command Output
38+
<!-- Paste relevant output between the two ``` lines below
39+
- Retrieve the log for your server:
40+
- Open the Indigo Plugins menu
41+
- Select HomeKit Bridge
42+
- Select Advanced Plugin Actions
43+
- Select the server having issues in the first Device field
44+
- Select `Show Homebridge Log` from Device Actions
45+
- Click the `Execute Action` button
46+
- Copy contents of the log from your Indigo Event Log window
47+
- Remove any sensitive information, passwords, etc.
48+
- If output is long please extract only the relevant portions if possible
49+
- However, please include the beginning of the log where the homebridge initialization happens if possible
50+
-->
51+
```
52+
53+
```
54+
55+
### Device Simulation Report
56+
<!-- Paste relevant output between the two ``` lines below
57+
- Retrieve the simulation data for your server:
58+
- Open the Indigo Plugins menu
59+
- Select HomeKit Bridge
60+
- Select Advanced Plugin Actions
61+
- Select the server having issues in the first Device field
62+
- Select `Simulate HomeKit For Server Item` from Device Actions
63+
- Select the device you are having problems with from the Server Device field
64+
- Click the `Execute Action` button
65+
- Copy contents of the log from your Indigo Event Log window
66+
- Remove any sensitive information, passwords, etc.
67+
- If output is long please extract only the relevant portions if possible
68+
-->
69+
```
70+
71+
```

CHANGES.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
Release Notes
22
==========
33

4-
Version 0.23.1 (Beta 23.1)
4+
Version 1.0.0 RC 1 (Release Candidate 1)
55
==========
6-
* Fixed bug in SenseMe support where fans and lights were not populating their HomeKit characteristics
7-
* Updated Homebridge-Indigo2 to 0.2.4
6+
* Final fixes for SenseMe fan/light support ([Issue #97](https://github.com/Colorado4Wheeler/HomeKit-Bridge/issues/97))
7+
* Adjusted acceptable value range on Heat and Cooling set points to allow for wider changes ([Issue #97](https://github.com/Colorado4Wheeler/HomeKit-Bridge/issues/97))
8+
* Added automatic server restart if the Homebridge debug option is changed
9+
* Removed Simulated Device Dump from plugin actions (still remains in device actions) in Advanced Plugin Actions menu since the recent changes have rendered that somewhat inoperable
10+
* Removed 'use new library' option from plugin config until needed again
11+
* Removed 'performance options' from plugin menu as it is no longer needed
12+
* Removed 'development testing' from plugin menu in preparation for release
13+
* Changed Homebridge debug checkbox in the server advanced options to a combobox that will allow the user to debug Homebridge-Indigo, Homebridge server, neither or both to allow for a full comprehensive debug if there are issues that require seeing what Homebridge is doing
14+
* Changed server device re-caching to only happen when the included devices or actions are changed in a server rather than on any properly or attribute change
15+
* [Issue #99](https://github.com/Colorado4Wheeler/HomeKit-Bridge/issues/99) resolved
16+
* [Issue #97](https://github.com/Colorado4Wheeler/HomeKit-Bridge/issues/97) resolved
817

918
Previous Release Notes
1019
==========
1120

21+
Version 0.23.1 (Beta 23.1)
22+
---------------
23+
* Fixed bug in SenseMe support where fans and lights were not populating their HomeKit characteristics
24+
* Updated Homebridge-Indigo2 to 0.2.4
25+
1226
Version 0.23.0 (Beta 23.0)
1327
---------------
1428
* **NOTE** As stated earlier, the entire HomeKit engine is being optimized and rewritten for various reasons. There is a new plugin configuration option that allows you to revert to the previous method if the new method is causing problem, but this is on a release-by-release basis, meaning that only changes in **this** release will roll back to using the old methods, the next release will not be able to roll back anything from this release. The functions impacted will be noted in the release notes as 'Library Change'. Please report any issues that are caused by the new library that are resolved by returning to the old methods. Each revision will re-enable this option automatically if it gets turned off.

EPS HomeKit Bridge.indigoPlugin/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>PluginVersion</key>
6-
<string>0.23.1</string>
6+
<string>1.0.0-rc1</string>
77
<key>ServerApiVersion</key>
88
<string>2.0</string>
99
<key>IwsApiVersion</key>

EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/Devices.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,16 @@
4949
<Label>HB callback:</Label>
5050
</Field>
5151

52-
<Field type="checkbox" id="hbDebug" defaultValue="false" visibleBindingId="configOption" visibleBindingValue="server" >
53-
<Label> </Label>
54-
<Description>Enable Homebridge debugging</Description>
55-
</Field>
52+
<Field type="menu" id="hbDebug" defaultValue="none" visibleBindingId="configOption" visibleBindingValue="server">
53+
<Label>Debugging:</Label>
54+
<List>
55+
<Option value="none">Debugging Off</Option>
56+
<Option value="hbi2">Debug Homebridge-Indigo script</Option>
57+
<Option value="hb">Debug Homebridge Server</Option>
58+
<Option value="both">Debug Homebridge and Indigo Script</Option>
59+
</List>
60+
<CallbackMethod>formFieldChanged</CallbackMethod>
61+
</Field>
5662

5763
<Field type="menu" id="tempunits" defaultValue="c" visibleBindingId="configOption" visibleBindingValue="config">
5864
<Label>In HomeKit:</Label>

EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/MenuItems.xml

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -112,82 +112,6 @@
112112
</MenuItem>
113113

114114
<MenuItem id="sep_excludes"/>
115-
116-
117-
<MenuItem id="performanceOptions">
118-
<Name>Performance Options</Name>
119-
<ButtonTitle>Save</ButtonTitle>
120-
<CallbackMethod>performanceOptions</CallbackMethod>
121-
<ConfigUI>
122-
<Field type="menu" id="pollingMode" defaultValue="realTime">
123-
<Label>Device Updating:</Label>
124-
<List>
125-
<Option value="realTime">Realtime Device Updating</Option>
126-
<Option value="pollDevice">Periodic Polling</Option>
127-
<Option value="concurrentThread">Concurrent Threading</Option>
128-
</List>
129-
</Field>
130-
131-
<Field id="realTime" type="label" visibleBindingId="pollingMode" visibleBindingValue="realTime">
132-
<Label>Monitors every change to the plugin device and any associated subdevices in real-time.
133-
134-
Under most circumstances this is preferred but if you create a lot of devices or subdevices in a plugin with a lot of calculations this can cause timeouts, high memory usage and performance problems for both Indigo and the plugin.
135-
136-
If you experience errors or timeouts in Indigo try changing to a different method.
137-
138-
139-
140-
141-
142-
</Label>
143-
</Field>
144-
145-
<Field id="pollDevice" type="label" visibleBindingId="pollingMode" visibleBindingValue="pollDevice">
146-
<Label>Instead of monitoring for device and subdevice changes, instead periodically poll the device based on a schedule.
147-
148-
This will result in less real-time information but is far more efficient in terms of memory and processor usage than real-time updating.
149-
150-
151-
152-
153-
</Label>
154-
</Field>
155-
156-
<Field id="concurrentThread" type="label" visibleBindingId="pollingMode" visibleBindingValue="concurrentThread">
157-
<Label>Only update information for the device and subdevices when the plugins Concurrent Threading occurs.
158-
159-
This is similar to polling but instead of checking every ~1 second to see if polling needs to occur the plugin will instead only update on a set interval and update devices with no further calculations.
160-
161-
Using this method is nit-picking performance since polling is almost equally as efficient, but if both other methods don't rectify performance problems or Indigo errors as a result of the plugin then this method is a good option.
162-
</Label>
163-
</Field>
164-
165-
<Field id="sep_pollingMode" type="separator" visibleBindingId="pollingMode" visibleBindingValue="pollDevice,concurrentThread" />
166-
167-
<Field id="realTimeSpacer" type="label" visibleBindingId="pollingMode" visibleBindingValue="realTime">
168-
<Label>
169-
170-
171-
</Label>
172-
</Field>
173-
174-
<Field id="pollingInterval" type="textfield" defaultValue="1" visibleBindingId="pollingMode" visibleBindingValue="pollDevice,concurrentThread">
175-
<Label>Interval:</Label>
176-
</Field>
177-
178-
<Field type="menu" id="pollingFrequency" defaultValue="s" visibleBindingId="pollingMode" visibleBindingValue="pollDevice,concurrentThread">
179-
<Label>Frequency:</Label>
180-
<List>
181-
<Option value="s">Seconds</Option>
182-
<Option value="m">Minutes</Option>
183-
<Option value="h">Hours</Option>
184-
</List>
185-
</Field>
186-
187-
</ConfigUI>
188-
</MenuItem>
189-
190-
<MenuItem id="sep_options"/>
191115

192116
<MenuItem id="libVersion">
193117
<Name>Show Support Information</Name>
@@ -199,11 +123,6 @@ Using this method is nit-picking performance since polling is almost equally as
199123
<CallbackMethod>version_check</CallbackMethod>
200124
</MenuItem>
201125

202-
<MenuItem id="devtest">
203-
<Name>Development Testing</Name>
204-
<CallbackMethod>devTest</CallbackMethod>
205-
</MenuItem>
206-
207126
<MenuItem id="sep_advanced"/>
208127

209128
<MenuItem id="advancedPluginActions">
@@ -271,7 +190,6 @@ Using this method is nit-picking performance since polling is almost equally as
271190
<Option value="health">Perform Health Check</Option>
272191
<Option value="data">Plugin Data Dump</Option>
273192
<Option value="compdata">Comprehensive Plugin Data Dump</Option>
274-
<Option value="simhomekit">Simulated HomeKit Device Data Dump</Option>
275193
<Option value="migratehbb">Migrate From Homebridge Buddy</Option>
276194
</List>
277195
</Field>

EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/PluginConfig.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
<Field id="sep_apiport" type="separator" />
6565

66-
<Field type="checkbox" id="newpackage" defaultValue="true" >
66+
<Field type="checkbox" id="newpackage" defaultValue="true" hidden="true">
6767
<Label>New Methods:</Label>
6868
<Description>Use new library methods for this release</Description>
6969
</Field>

EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/bin/hb/homebridge/runhomebridge

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ if [ -f "$LOG.2" ]; then /bin/mv -f "$LOG.2" "$LOG.3"; fi
2323
if [ -f "$LOG.1" ]; then /bin/mv -f "$LOG.1" "$LOG.2"; fi
2424
if [ -f "$LOG" ]; then /bin/mv -f "$LOG" "$LOG.1"; fi
2525

26+
if [ -f "$CDIR/homebridge.debug" ]; then
27+
. "$CDIR/homebridge.debug"
28+
fi
29+
2630
exec "$DIR/homebridge" -D -U "$CDIR" -P "$CDIR" > "$LOG" 2>&1
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
5+
export PATH="$DIR:/usr/bin:/bin:/usr/sbin:/sbin"
6+
export NODE_PATH="$( "$DIR/npm" -g root )"
7+
8+
NAME="$1"
9+
10+
if [[ "$NAME" == /* ]]; then
11+
CDIR="$NAME"
12+
else
13+
CDIR="$DIR/$NAME"
14+
fi
15+
16+
LOG="$CDIR/homebridge.log"
17+
18+
if [ -f "$LOG.6" ]; then /bin/mv -f "$LOG.6" "$LOG.7"; fi
19+
if [ -f "$LOG.5" ]; then /bin/mv -f "$LOG.5" "$LOG.6"; fi
20+
if [ -f "$LOG.4" ]; then /bin/mv -f "$LOG.4" "$LOG.5"; fi
21+
if [ -f "$LOG.3" ]; then /bin/mv -f "$LOG.3" "$LOG.4"; fi
22+
if [ -f "$LOG.2" ]; then /bin/mv -f "$LOG.2" "$LOG.3"; fi
23+
if [ -f "$LOG.1" ]; then /bin/mv -f "$LOG.1" "$LOG.2"; fi
24+
if [ -f "$LOG" ]; then /bin/mv -f "$LOG" "$LOG.1"; fi
25+
26+
exec "$DIR/homebridge" -D -U "$CDIR" -P "$CDIR" > "$LOG" 2>&1

EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/lib/homekit.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,9 +1573,11 @@ def setAttributeValue (self, attribute, value):
15731573
if attribute == "Brightness":
15741574
self.Brightness.minValue = 0
15751575
self.Brightness.maxValue = 16
1576+
self.Brightness.changeMinMax = True
15761577
if attribute == "RotationSpeed":
15771578
self.RotationSpeed.minValue = 0
15781579
self.RotationSpeed.maxValue = 7
1580+
self.RotationSpeed.changeMinMax = True
15791581

15801582
# Do temperature conversion on the value
15811583
if attribute in ["CurrentTemperature", "TargetTemperature", "HeatingThresholdTemperature", "CoolingThresholdTemperature"]:
@@ -2229,7 +2231,7 @@ def special_SenseMeFanSpeed (self, classes, sourceDict, getter, characteristic,
22292231
self.characterDict[characteristic] = getattr (self, characteristic).value
22302232

22312233
valuesDict = {'speed': "=value="}
2232-
self.actions.append (HomeKitAction(characteristic, "between", 0, "homekit.runPluginAction", [indigo.devices[self.objId].pluginId, None, ["fanSpeed", self.objId, valuesDict]], 7, {self.objId: "state_speed"}))
2234+
self.actions.append (HomeKitAction(characteristic, "between", 0, "homekit.runPluginAction", [indigo.devices[self.objId].pluginId, "=value=", ["fanSpeed", self.objId, valuesDict]], 7, {self.objId: "state_speed"}))
22332235

22342236
except Exception as e:
22352237
self.logger.error (ext.getException(e) + "\nFor object id {} alias '{}'".format(str(self.objId), self.alias.value))
@@ -2258,12 +2260,14 @@ def special_SenseMeLightLevel (self, classes, sourceDict, getter, characteristic
22582260
try:
22592261
if self.serverId == 0: return
22602262

2263+
obj = indigo.devices[self.objId]
2264+
22612265
value = int(obj.states["brightness"])
22622266
self.setAttributeValue (characteristic, value)
22632267
self.characterDict[characteristic] = getattr (self, characteristic).value
22642268

22652269
valuesDict = {'lightLevel': "=value="}
2266-
self.actions.append (HomeKitAction(characteristic, "between", 0, "homekit.runPluginAction", [indigo.devices[self.objId].pluginId, None, ["fanLightBrightness", self.objId, valuesDict]], 16, {self.objId: "state_brightness"}))
2270+
self.actions.append (HomeKitAction(characteristic, "between", 0, "homekit.runPluginAction", [indigo.devices[self.objId].pluginId, "=value=", ["fanLightBrightness", self.objId, valuesDict]], 16, {self.objId: "state_brightness"}))
22672271

22682272
except Exception as e:
22692273
self.logger.error (ext.getException(e) + "\nFor object id {} alias '{}'".format(str(self.objId), self.alias.value))
@@ -2545,7 +2549,7 @@ def run (self, value, objId, waitForComplete = True):
25452549

25462550
for c in cmd:
25472551
func = getattr(func, c)
2548-
2552+
25492553
if len(args) > 0:
25502554
retval = func(*args)
25512555
else:
@@ -2708,8 +2712,9 @@ def runPluginAction (self, pluginId, value, arguments):
27082712
args.append(value)
27092713
else:
27102714
args.append(a)
2711-
2712-
self.logger.threaddebug (u"Running plugin action on {} with {}".format(pluginId, unicode(args)))
2715+
2716+
#self.logger.warning (u"Value passed is {}".format(value))
2717+
self.logger.debug (u"Running plugin action on {} with {}".format(pluginId, unicode(args)))
27132718
result = plugin.executeAction(*args, waitUntilDone=True)
27142719
self.logger.threaddebug (u"Plugin action return value: " + unicode(result))
27152720
else:
@@ -4128,13 +4133,13 @@ def __init__(self):
41284133
class characteristic_CoolingThresholdTemperature:
41294134
def __init__(self):
41304135
self.value = 0.0
4131-
self.maxValue = 35
4136+
self.maxValue = 38
41324137
self.minValue = 10
41334138
self.minStep = 0.1
41344139

41354140
self.readonly = False
41364141
self.notify = True
4137-
self.changeMinMax = False
4142+
self.changeMinMax = True
41384143

41394144
# ==============================================================================
41404145
# CURRENT AMBIENT LIGHT LEVEL
@@ -4384,13 +4389,13 @@ def __init__(self):
43844389
class characteristic_HeatingThresholdTemperature:
43854390
def __init__(self):
43864391
self.value = 0.0
4387-
self.maxValue = 25
4392+
self.maxValue = 38
43884393
self.minValue = 0
43894394
self.minStep = 0.1
43904395

43914396
self.readonly = False
43924397
self.notify = True
4393-
self.changeMinMax = False
4398+
self.changeMinMax = True
43944399

43954400
# ==============================================================================
43964401
# HOLD POSITION

0 commit comments

Comments
 (0)