Skip to content

Commit

Permalink
1.0.0-rc1
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Colorado Four Wheeler authored and Colorado Four Wheeler committed Apr 19, 2018
1 parent c013025 commit 8cc4be8
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 115 deletions.
71 changes: 71 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!-- Provide a general summary in the Title above -->

<!-- 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. -->

### Expected Behavior
<!-- If you're describing a bug, tell us what should happen -->
<!-- If you're suggesting a change/improvement, tell us how it should work -->

### Current Behavior
<!-- If describing a bug, tell us what happens instead of the expected behavior -->
<!-- If suggesting a change/improvement, explain the difference from current behavior -->

### Steps to Reproduce (for bugs)
<!-- Please add a series of steps to reproduce the problem. -->

### Versions
<!-- Please provide the version of the plugin you are running (found in the Plugins menu under HomeKit Bridge). -->
- **Plugin**: `YourVersion`

### Configuration
<!-- If relevant, include the contents of your config.json file between the two ``` lines below.
- Retrieve the configuration for your server:
- Open the Indigo Plugins menu
- Select HomeKit Bridge
- Select Advanced Plugin Actions
- Select the server having issues in the first Device field
- Select `Show Homebridge Configuration` from Device Actions
- Click the `Execute Action` button
- Copy contents of the log from your Indigo Event Log window
- Remove any sensitive information, passwords, etc.
- If output is long please extract only the relevant portions if possible
-->
```json

```

### Homebridge Log / Command Output
<!-- Paste relevant output between the two ``` lines below
- Retrieve the log for your server:
- Open the Indigo Plugins menu
- Select HomeKit Bridge
- Select Advanced Plugin Actions
- Select the server having issues in the first Device field
- Select `Show Homebridge Log` from Device Actions
- Click the `Execute Action` button
- Copy contents of the log from your Indigo Event Log window
- Remove any sensitive information, passwords, etc.
- If output is long please extract only the relevant portions if possible
- However, please include the beginning of the log where the homebridge initialization happens if possible
-->
```
```

### Device Simulation Report
<!-- Paste relevant output between the two ``` lines below
- Retrieve the simulation data for your server:
- Open the Indigo Plugins menu
- Select HomeKit Bridge
- Select Advanced Plugin Actions
- Select the server having issues in the first Device field
- Select `Simulate HomeKit For Server Item` from Device Actions
- Select the device you are having problems with from the Server Device field
- Click the `Execute Action` button
- Copy contents of the log from your Indigo Event Log window
- Remove any sensitive information, passwords, etc.
- If output is long please extract only the relevant portions if possible
-->
```
```
20 changes: 17 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
Release Notes
==========

Version 0.23.1 (Beta 23.1)
Version 1.0.0 RC 1 (Release Candidate 1)
==========
* Fixed bug in SenseMe support where fans and lights were not populating their HomeKit characteristics
* Updated Homebridge-Indigo2 to 0.2.4
* Final fixes for SenseMe fan/light support ([Issue #97](https://github.com/Colorado4Wheeler/HomeKit-Bridge/issues/97))
* 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))
* 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](https://github.com/Colorado4Wheeler/HomeKit-Bridge/issues/99) resolved
* [Issue #97](https://github.com/Colorado4Wheeler/HomeKit-Bridge/issues/97) resolved

Previous Release Notes
==========

Version 0.23.1 (Beta 23.1)
---------------
* Fixed bug in SenseMe support where fans and lights were not populating their HomeKit characteristics
* Updated Homebridge-Indigo2 to 0.2.4

Version 0.23.0 (Beta 23.0)
---------------
* **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.
Expand Down
2 changes: 1 addition & 1 deletion EPS HomeKit Bridge.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>0.23.1</string>
<string>1.0.0-rc1</string>
<key>ServerApiVersion</key>
<string>2.0</string>
<key>IwsApiVersion</key>
Expand Down
14 changes: 10 additions & 4 deletions EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/Devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@
<Label>HB callback:</Label>
</Field>

<Field type="checkbox" id="hbDebug" defaultValue="false" visibleBindingId="configOption" visibleBindingValue="server" >
<Label> </Label>
<Description>Enable Homebridge debugging</Description>
</Field>
<Field type="menu" id="hbDebug" defaultValue="none" visibleBindingId="configOption" visibleBindingValue="server">
<Label>Debugging:</Label>
<List>
<Option value="none">Debugging Off</Option>
<Option value="hbi2">Debug Homebridge-Indigo script</Option>
<Option value="hb">Debug Homebridge Server</Option>
<Option value="both">Debug Homebridge and Indigo Script</Option>
</List>
<CallbackMethod>formFieldChanged</CallbackMethod>
</Field>

<Field type="menu" id="tempunits" defaultValue="c" visibleBindingId="configOption" visibleBindingValue="config">
<Label>In HomeKit:</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,82 +112,6 @@
</MenuItem>

<MenuItem id="sep_excludes"/>


<MenuItem id="performanceOptions">
<Name>Performance Options</Name>
<ButtonTitle>Save</ButtonTitle>
<CallbackMethod>performanceOptions</CallbackMethod>
<ConfigUI>
<Field type="menu" id="pollingMode" defaultValue="realTime">
<Label>Device Updating:</Label>
<List>
<Option value="realTime">Realtime Device Updating</Option>
<Option value="pollDevice">Periodic Polling</Option>
<Option value="concurrentThread">Concurrent Threading</Option>
</List>
</Field>

<Field id="realTime" type="label" visibleBindingId="pollingMode" visibleBindingValue="realTime">
<Label>Monitors every change to the plugin device and any associated subdevices in real-time.

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.

If you experience errors or timeouts in Indigo try changing to a different method.





</Label>
</Field>

<Field id="pollDevice" type="label" visibleBindingId="pollingMode" visibleBindingValue="pollDevice">
<Label>Instead of monitoring for device and subdevice changes, instead periodically poll the device based on a schedule.

This will result in less real-time information but is far more efficient in terms of memory and processor usage than real-time updating.




</Label>
</Field>

<Field id="concurrentThread" type="label" visibleBindingId="pollingMode" visibleBindingValue="concurrentThread">
<Label>Only update information for the device and subdevices when the plugins Concurrent Threading occurs.

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.

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.
</Label>
</Field>

<Field id="sep_pollingMode" type="separator" visibleBindingId="pollingMode" visibleBindingValue="pollDevice,concurrentThread" />

<Field id="realTimeSpacer" type="label" visibleBindingId="pollingMode" visibleBindingValue="realTime">
<Label>


</Label>
</Field>

<Field id="pollingInterval" type="textfield" defaultValue="1" visibleBindingId="pollingMode" visibleBindingValue="pollDevice,concurrentThread">
<Label>Interval:</Label>
</Field>

<Field type="menu" id="pollingFrequency" defaultValue="s" visibleBindingId="pollingMode" visibleBindingValue="pollDevice,concurrentThread">
<Label>Frequency:</Label>
<List>
<Option value="s">Seconds</Option>
<Option value="m">Minutes</Option>
<Option value="h">Hours</Option>
</List>
</Field>

</ConfigUI>
</MenuItem>

<MenuItem id="sep_options"/>

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

<MenuItem id="devtest">
<Name>Development Testing</Name>
<CallbackMethod>devTest</CallbackMethod>
</MenuItem>

<MenuItem id="sep_advanced"/>

<MenuItem id="advancedPluginActions">
Expand Down Expand Up @@ -271,7 +190,6 @@ Using this method is nit-picking performance since polling is almost equally as
<Option value="health">Perform Health Check</Option>
<Option value="data">Plugin Data Dump</Option>
<Option value="compdata">Comprehensive Plugin Data Dump</Option>
<Option value="simhomekit">Simulated HomeKit Device Data Dump</Option>
<Option value="migratehbb">Migrate From Homebridge Buddy</Option>
</List>
</Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

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

<Field type="checkbox" id="newpackage" defaultValue="true" >
<Field type="checkbox" id="newpackage" defaultValue="true" hidden="true">
<Label>New Methods:</Label>
<Description>Use new library methods for this release</Description>
</Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ if [ -f "$LOG.2" ]; then /bin/mv -f "$LOG.2" "$LOG.3"; fi
if [ -f "$LOG.1" ]; then /bin/mv -f "$LOG.1" "$LOG.2"; fi
if [ -f "$LOG" ]; then /bin/mv -f "$LOG" "$LOG.1"; fi

if [ -f "$CDIR/homebridge.debug" ]; then
. "$CDIR/homebridge.debug"
fi

exec "$DIR/homebridge" -D -U "$CDIR" -P "$CDIR" > "$LOG" 2>&1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

export PATH="$DIR:/usr/bin:/bin:/usr/sbin:/sbin"
export NODE_PATH="$( "$DIR/npm" -g root )"

NAME="$1"

if [[ "$NAME" == /* ]]; then
CDIR="$NAME"
else
CDIR="$DIR/$NAME"
fi

LOG="$CDIR/homebridge.log"

if [ -f "$LOG.6" ]; then /bin/mv -f "$LOG.6" "$LOG.7"; fi
if [ -f "$LOG.5" ]; then /bin/mv -f "$LOG.5" "$LOG.6"; fi
if [ -f "$LOG.4" ]; then /bin/mv -f "$LOG.4" "$LOG.5"; fi
if [ -f "$LOG.3" ]; then /bin/mv -f "$LOG.3" "$LOG.4"; fi
if [ -f "$LOG.2" ]; then /bin/mv -f "$LOG.2" "$LOG.3"; fi
if [ -f "$LOG.1" ]; then /bin/mv -f "$LOG.1" "$LOG.2"; fi
if [ -f "$LOG" ]; then /bin/mv -f "$LOG" "$LOG.1"; fi

exec "$DIR/homebridge" -D -U "$CDIR" -P "$CDIR" > "$LOG" 2>&1
Original file line number Diff line number Diff line change
Expand Up @@ -1573,9 +1573,11 @@ def setAttributeValue (self, attribute, value):
if attribute == "Brightness":
self.Brightness.minValue = 0
self.Brightness.maxValue = 16
self.Brightness.changeMinMax = True
if attribute == "RotationSpeed":
self.RotationSpeed.minValue = 0
self.RotationSpeed.maxValue = 7
self.RotationSpeed.changeMinMax = True

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

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

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

obj = indigo.devices[self.objId]

value = int(obj.states["brightness"])
self.setAttributeValue (characteristic, value)
self.characterDict[characteristic] = getattr (self, characteristic).value

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

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

for c in cmd:
func = getattr(func, c)

if len(args) > 0:
retval = func(*args)
else:
Expand Down Expand Up @@ -2708,8 +2712,9 @@ def runPluginAction (self, pluginId, value, arguments):
args.append(value)
else:
args.append(a)

self.logger.threaddebug (u"Running plugin action on {} with {}".format(pluginId, unicode(args)))

#self.logger.warning (u"Value passed is {}".format(value))
self.logger.debug (u"Running plugin action on {} with {}".format(pluginId, unicode(args)))
result = plugin.executeAction(*args, waitUntilDone=True)
self.logger.threaddebug (u"Plugin action return value: " + unicode(result))
else:
Expand Down Expand Up @@ -4128,13 +4133,13 @@ def __init__(self):
class characteristic_CoolingThresholdTemperature:
def __init__(self):
self.value = 0.0
self.maxValue = 35
self.maxValue = 38
self.minValue = 10
self.minStep = 0.1

self.readonly = False
self.notify = True
self.changeMinMax = False
self.changeMinMax = True

# ==============================================================================
# CURRENT AMBIENT LIGHT LEVEL
Expand Down Expand Up @@ -4384,13 +4389,13 @@ def __init__(self):
class characteristic_HeatingThresholdTemperature:
def __init__(self):
self.value = 0.0
self.maxValue = 25
self.maxValue = 38
self.minValue = 0
self.minStep = 0.1

self.readonly = False
self.notify = True
self.changeMinMax = False
self.changeMinMax = True

# ==============================================================================
# HOLD POSITION
Expand Down
Loading

0 comments on commit 8cc4be8

Please sign in to comment.