Skip to content

Commit

Permalink
1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Colorado Four Wheeler authored and Colorado Four Wheeler committed Jul 18, 2018
1 parent d758682 commit e27a0f0
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 44 deletions.
14 changes: 11 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
Release Notes
==========

Version 1.0.2-beta.3
Version 1.0.2 Final
---------------
* Added ability to change color using the color temperature wheel in Home. Strictly speaking, color temperature is a color from white to orange (and this is how the Hue app sees it and then how the Hue app deals with it when it integrates into Home), therefore when you use the color temperature wheel it will set the color from white to orange, if you want actual colors then you use the color wheel instead. Confused? Yea, it is confusing.
* Fixed an issue where brightness controls were incorporated into the color setting (which they are when setting the RGB values of a light) and as a result that meant that changing brightness in Home didn't actually change the bulb brightness, this has been restored to the pre 1.0.2 setting of brightness changing brightness as normal when using an RGB light
* Added ability for temperature sensors to use ANY device that has a state named "temp", "temperature" or "Temperature", this opens up compatibility to a large number of plugins and sensors that use this state name without having to support those plugin individually. As a result, direct support for certain plugins was removed if they had been coded to use the "temperature" or "temp" states, such as wunderground.wunderground, piBeacon.i2cTMP102, piBeacon.i2cBMExx, piBeacon.i2cMS5803 and fantasticwWeather.Weather (these devices should continue to work just fine but no longer need special integration).
* Added ability for humidity sensors to use ANY device that has a state named "relativeHumidity", "humidity" or "Humidity", opening up compatibility to any plugin device or sensor that uses this state name without having to support those plugins specifically. As a result, direct support for certain plugins was removed if they had been coded to use one of these states, such as piBeacon.i2cBMExx, fantasticwWeather.Weather and wunderground.wunderground
* Changed behavior of the HomeKit name field so that each time a device is changed it will change the HomeKit name to match unless editing an existing item, in which case the HomeKit name will not change unless done so manually
* Changed the UI button "Add to HomeKit" to "Save Device" so that it better represents the action to take when both adding and editing a HomeKit device
* Changed Speaker description to "3rd Party, Mute control in Home, Full Siri" because HomeKit updates since HomePod have allowed this device type to be used by Home but only in a mute/unmute capacity but no volume control. Volume can still be changed via Siri.

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

Version 1.0.2-beta.3
---------------
* Added ability to change color using the color temperature wheel in Home. Strictly speaking, color temperature is a color from white to orange (and this is how the Hue app sees it and then how the Hue app deals with it when it integrates into Home), therefore when you use the color temperature wheel it will set the color from white to orange, if you want actual colors then you use the color wheel instead. Confused? Yea, it is confusing.
* Fixed an issue where brightness controls were incorporated into the color setting (which they are when setting the RGB values of a light) and as a result that meant that changing brightness in Home didn't actually change the bulb brightness, this has been restored to the pre 1.0.2 setting of brightness changing brightness as normal when using an RGB light

Version 1.0.2-beta.2
---------------
* Fixed issue where a color supporting bulb that does not support RGB would cause the plugin to error (note, right now only RGB capable bulbs are supported)
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>1.0.2-beta.3</string>
<string>1.0.2</string>
<key>ServerApiVersion</key>
<string>2.0</string>
<key>IwsApiVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<Option value="config">Server Options</Option>
<Option value="include">Manage Devices and Action Groups</Option>
</List>
<CallbackMethod>formFieldChanged</CallbackMethod>
<CallbackMethod>serverFormFieldChanged_configOption</CallbackMethod>
</Field>

<Field type="separator" id="sep_configOption" />
Expand Down Expand Up @@ -181,7 +181,7 @@
<Option value="hide">Delete and Hide (Single/Multiple Items)</Option>
<Option value="remove">Delete and Exclude (Single/Multiple Items)</Option>
</List>
<CallbackMethod>formFieldChanged</CallbackMethod>
<CallbackMethod>serverFormFieldChanged_objectAction</CallbackMethod>
</Field>

<Field type="label" id="lbl_spacer6" visibleBindingId="configOption" visibleBindingValue="include" alwaysUseInDialogHeightCalc="true">
Expand Down Expand Up @@ -218,7 +218,7 @@
</Field>

<Field type="label" id="lbl_editactivewarning" fontColor="red" fontSize="small" visibleBindingId="editActive" visibleBindingValue="true" alwaysUseInDialogHeightCalc="true" >
<Label>You are currently in EDIT mode. When you edit an item you are removing it from the devices and actions shared with HomeKit so it can be edited and saved back. For this reason you must 'Add To HomeKit' when done editing so you don't lose your changes. If you no longer want this item shared, please use the delete action(s) instead.
<Label>You are currently in EDIT mode. When you edit an item you are removing it from the devices and actions shared with HomeKit so it can be edited and saved back. For this reason you must 'Save Device' when done editing so you don't lose your changes. If you no longer want this item shared, please use the delete action(s) instead.
</Label>
</Field>

Expand Down Expand Up @@ -337,16 +337,15 @@
</Label>
</Field>



<Field type="button" id="add" enabledBindingId="deviceLimitReached" enabledBindingNegate="true" visibleBindingId="deviceOrActionSelected" visibleBindingValue="true" >
<Label> </Label>
<Title>Add To HomeKit </Title>
<Title>Save Device </Title>
<CallbackMethod>serverButtonAddDeviceOrAction</CallbackMethod>
</Field>





</ConfigUI>
<UiDisplayStateId>onOffState</UiDisplayStateId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def printClassLookupDict (self):
if "special_" in state:
values += "**{}** ({}) | ".format("Calculated", state.replace("special_", ""))
else:
values += "**{}** ({}) | ".format(state.replace("attr_", "").replace("state_", ""), devtype.replace("*", "all").replace("indigo.", ""))
values += "**{}** ({}) | ".format(state.replace("attr_", "").replace("state_", ""), devtype.replace("****", "all").replace("***", "all").replace("**", "all").replace("*", "all").replace("indigo.", ""))
else:
values += "**TBD** | "

Expand Down Expand Up @@ -994,9 +994,28 @@ def detCharacteristicValues (self, classes, sourceDict, isOptional = False):
getter = getters[self.pluginType]
elif self.indigoType in getters:
getter = getters[self.indigoType]
elif "*" in getters:
getter = getters["*"]
elif "*" in getters or "**" in getters or "***" in getters or "****" in getters:
try:
#if self.objId == 917972316: indigo.server.log(unicode(getters))
obj = indigo.devices[self.objId]
for plugin, attribute in getters.iteritems():
if plugin.startswith('*'):
#if self.objId == 917972316: indigo.server.log(u'{}: {}'.format(plugin, attribute))
if 'states' in dir(obj) and attribute.replace('state_', '') in obj.states:
getter = attribute
break

if attribute.replace('attr_', '') in dir(obj):
getter = attribute
break

except Exception as ee:
self.logger.error (ext.getException(ee))

if not getter: getter = getters["*"]

#if self.objId == 917972316: indigo.server.log(u'Using getter: {}'.format(getter))

#indigo.server.log ("{}: {} is {}".format(self.alias.value, characteristic, getter))
#if getter is None: indigo.server.log ("{}: {}".format(self.alias.value, self.pluginType))

Expand Down Expand Up @@ -2445,7 +2464,7 @@ def XXXspecial_HSL (self, classes, sourceDict, getter, characteristic, isOptiona
def special_HSV (self, classes, sourceDict, getter, characteristic, isOptional = False):
try:
obj = indigo.devices[self.objId]
if "supportsColor" in dir(obj) and obj.supportsColor:
if "supportsRGB" in dir(obj) and obj.supportsRGB:
r = obj.redLevel
g = obj.greenLevel
b = obj.blueLevel
Expand Down Expand Up @@ -3543,7 +3562,8 @@ def __init__ (self, factory, objId, serverId = 0, characterDict = {}, deviceActi
super(service_HumiditySensor, self).__init__ (factory, type, desc, objId, serverId, characterDict, deviceActions, loadOptional)

self.required = {}
self.required["CurrentRelativeHumidity"] = {"*": "attr_sensorValue", "indigo.ThermostatDevice": "state_humidityInput1", "indigo.Device.com.fogbert.indigoplugin.wunderground.wunderground": "state_relativeHumidity", "indigo.Device.com.karlwachs.piBeacon.i2cBMExx": "state_Humidity", "indigo.Device.com.eps.indigoplugin.device-extensions.epsdecon": "state_convertedValue", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Weather": "state_humidity", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Daily": "state_d01_humidity"}
#self.required["CurrentRelativeHumidity"] = {"*": "attr_sensorValue", "indigo.ThermostatDevice": "state_humidityInput1", "indigo.Device.com.fogbert.indigoplugin.wunderground.wunderground": "state_relativeHumidity", "indigo.Device.com.karlwachs.piBeacon.i2cBMExx": "state_Humidity", "indigo.Device.com.eps.indigoplugin.device-extensions.epsdecon": "state_convertedValue", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Weather": "state_humidity", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Daily": "state_d01_humidity"}
self.required["CurrentRelativeHumidity"] = {"*": "attr_sensorValue", "**": "Humidity", "***": "humidity", "****": "relativeHumidity", "indigo.ThermostatDevice": "state_humidityInput1", "indigo.Device.com.eps.indigoplugin.device-extensions.epsdecon": "state_convertedValue", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Daily": "state_d01_humidity"}

self.optional = {}
self.optional["StatusActive"] = {}
Expand Down Expand Up @@ -3639,16 +3659,10 @@ def __init__ (self, factory, objId, serverId = 0, characterDict = {}, deviceActi
#self.optional["Saturation"] = {"indigo.DimmerDevicexxx": "special_HSL", "indigo.DimmerDevice.com.nathansheldon.indigoplugin.HueLights.hueBulb": "state_saturation", "indigo.DimmerDevice.com.autologplugin.indigoplugin.lifxcontroller.lifxDevice": "state_hsbkSaturation"}
self.optional["Name"] = {}
#self.optional["ColorTemperature"] = {"indigo.DimmerDevicexxx": "special_HSL", "indigo.DimmerDevice.com.nathansheldon.indigoplugin.HueLights.hueBulb": "state_colorTemp", "indigo.DimmerDevice.com.autologplugin.indigoplugin.lifxcontroller.lifxDevice": "state_hsbkKelvin"}

try:
obj = indigo.devices[objId]
if "supportsRGB" in dir(obj) and obj.supportsRGB:
#self.optional["Brightness"] = {"indigo.DimmerDevice": "special_HSV"}
self.optional["Hue"] = {"indigo.DimmerDevice": "special_HSV"}
self.optional["Saturation"] = {"indigo.DimmerDevice": "special_HSV"}
self.optional["ColorTemperature"] = {"indigo.DimmerDevice": "special_HSV"}
except:
pass

self.optional["Hue"] = {"indigo.DimmerDevice": "special_HSV"}
self.optional["Saturation"] = {"indigo.DimmerDevice": "special_HSV"}
self.optional["ColorTemperature"] = {"indigo.DimmerDevice": "special_HSV"}

super(service_Lightbulb, self).setAttributes ()

Expand Down Expand Up @@ -3936,7 +3950,7 @@ class service_Speaker (Service):
#
def __init__ (self, factory, objId, serverId = 0, characterDict = {}, deviceActions = [], loadOptional = False):
type = "Speaker"
desc = "Speaker (3rd Party and Siri Only)"
desc = "Speaker (3rd Party, Mute control in Home, Full Siri)"

self.wiki = "This service is unsupported by the native Apple Home application but is supported, in varying degrees, in 3rd party HomeKit apps. Apps tested with this service that work are the [non-Apple version of Home](https://itunes.apple.com/us/app/home-smart-home-automation/id995994352?mt=8) and [Elgato Eve](https://itunes.apple.com/us/app/elgato-eve/id917695792?mt=8)."

Expand Down Expand Up @@ -4016,7 +4030,8 @@ def __init__ (self, factory, objId, serverId = 0, characterDict = {}, deviceActi

self.required = {}
#self.required["CurrentTemperature"] = {"indigo.SensorDevice": "special_sensorTemperature", "indigo.Device.com.fogbert.indigoplugin.wunderground.wunderground": "special_wuTemperature", "indigo.ThermostatDevice": "special_thermTemperature", "indigo.Device.com.perceptiveautomation.indigoplugin.weathersnoop.ws3station": "special_wsTemperature"}
self.required["CurrentTemperature"] = {"indigo.SensorDevice": "attr_sensorValue", "indigo.Device.com.fogbert.indigoplugin.wunderground.wunderground": "state_temp", "indigo.ThermostatDevice": "state_temperatureInput1", "indigo.Device.com.perceptiveautomation.indigoplugin.weathersnoop.ws3station": "state_temperature_F", "indigo.Device.com.karlwachs.piBeacon.i2cTMP102": "state_Temperature", "indigo.Device.com.karlwachs.piBeacon.i2cBMExx": "state_Temperature", "indigo.Device.com.karlwachs.piBeacon.i2cMS5803": "state_Temperature", "indigo.Device.com.eps.indigoplugin.device-extensions.epsdecon": "state_convertedValue", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Weather": "state_temperature", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Daily": "state_d01_temperatureHigh"}
#self.required["CurrentTemperature"] = {"*": "state_temperature", "*": "state_temp", "indigo.SensorDevice": "attr_sensorValue", "indigo.Device.com.fogbert.indigoplugin.wunderground.wunderground": "state_temp", "indigo.ThermostatDevice": "state_temperatureInput1", "indigo.Device.com.perceptiveautomation.indigoplugin.weathersnoop.ws3station": "state_temperature_F", "indigo.Device.com.karlwachs.piBeacon.i2cTMP102": "state_Temperature", "indigo.Device.com.karlwachs.piBeacon.i2cBMExx": "state_Temperature", "indigo.Device.com.karlwachs.piBeacon.i2cMS5803": "state_Temperature", "indigo.Device.com.eps.indigoplugin.device-extensions.epsdecon": "state_convertedValue", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Weather": "state_temperature", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Daily": "state_d01_temperatureHigh"}
self.required["CurrentTemperature"] = {"*": "state_temperature", "**": "state_Temperature", "***": "state_temp", "indigo.SensorDevice": "attr_sensorValue", "indigo.ThermostatDevice": "state_temperatureInput1", "indigo.Device.com.perceptiveautomation.indigoplugin.weathersnoop.ws3station": "state_temperature_F", "indigo.Device.com.eps.indigoplugin.device-extensions.epsdecon": "state_convertedValue", "indigo.Device.com.fogbert.indigoplugin.fantasticwWeather.Daily": "state_d01_temperatureHigh"}

self.optional = {}
self.optional["StatusActive"] = {}
Expand Down
71 changes: 61 additions & 10 deletions EPS HomeKit Bridge.indigoPlugin/Contents/Server Plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,12 @@ def version_check(self):
#
def pluginUpgraded (self, lastVersion, currentVersion):
try:
lastmajor, lastminor, lastrev = lastVersion.split(".")
#lastmajor, lastminor, lastminor = lastVersion.split(".")
lastv = lastVersion.split(".")
if len(lastv) >= 3:
lastmajor = lastv[0]
lastminor = lastv[1]
lastminor = lastv[2]

if lastVersion == "0.0.1": # Prior to adding version to prefs
self.logger.info (u"Upgrading plugin to {}".format(currentVersion))
Expand Down Expand Up @@ -3595,7 +3600,8 @@ def serverFormFieldChanged_Device (self, valuesDict, typeId, devId):
valuesDict["enableOnOffInvert"] = False

# Populate the name of the device if it is not already populated (this way if they are editing and change devices the alias remains the same)
if valuesDict["alias"] == "": valuesDict["alias"] = indigo.devices[int(valuesDict["device"])].name
#if valuesDict["alias"] == "": valuesDict["alias"] = indigo.devices[int(valuesDict["device"])].name
if not valuesDict['editActive']: valuesDict["alias"] = indigo.devices[int(valuesDict["device"])].name

# So long as we are not in edit mode then pull the HK defaults for this device and populate it
if not valuesDict["editActive"]:
Expand Down Expand Up @@ -3649,7 +3655,7 @@ def serverFormFieldChanged_Action (self, valuesDict, typeId, devId):
valuesDict["enableOnOffInvert"] = False # NEVER show this on Actions
valuesDict["isFahrenheitEnabled"] = False

valuesDict["alias"] = indigo.actionGroups[int(valuesDict["action"])].name
if not valuesDict['editActive']: valuesDict["alias"] = indigo.actionGroups[int(valuesDict["action"])].name

# So long as we are not in edit mode then pull the HK defaults for this device and populate it
if not valuesDict["editActive"]:
Expand All @@ -3668,6 +3674,51 @@ def serverFormFieldChanged_Action (self, valuesDict, typeId, devId):

return (valuesDict, errorsDict)

#
# Server form object action field changed
#
def serverFormFieldChanged_objectAction (self, valuesDict, typeId, devId):
try:
errorsDict = indigo.Dict()

if valuesDict["objectAction"] == "add":
valuesDict["showEditArea"] = True
valuesDict['deviceOrActionSelected'] = True
else:
if not valuesDict["editActive"]:
valuesDict["showEditArea"] = False
valuesDict['deviceOrActionSelected'] = False
else:
valuesDict["showEditArea"] = True
valuesDict['deviceOrActionSelected'] = True

except Exception as e:
self.logger.error (ext.getException(e))

return (valuesDict, errorsDict)

#
# Server form option screen field changed
#
def serverFormFieldChanged_configOption (self, valuesDict, typeId, devId):
try:
errorsDict = indigo.Dict()

if valuesDict["configOption"] != "include":
valuesDict["showEditArea"] = False
valuesDict['deviceOrActionSelected'] = False
valuesDict['enableOnOffInvert'] = False
valuesDict['editActive'] = False
if 'editing_record' in valuesDict: del(valuesDict["editing_record"])
else:
return self.serverFormFieldChanged_objectAction(valuesDict, typeId, devId)

except Exception as e:
self.logger.error (ext.getException(e))

return (valuesDict, errorsDict)


#
# Server form field change
#
Expand Down Expand Up @@ -3744,13 +3795,13 @@ def serverFormFieldChanged (self, valuesDict, typeId, devId):
else:
valuesDict["isFahrenheitEnabled"] = False

if valuesDict["objectAction"] == "add":
valuesDict["showEditArea"] = True
else:
if not valuesDict["editActive"]:
valuesDict["showEditArea"] = False
else:
valuesDict["showEditArea"] = True
#if valuesDict["objectAction"] == "add":
# valuesDict["showEditArea"] = True
#else:
# if not valuesDict["editActive"]:
# valuesDict["showEditArea"] = False
# else:
# valuesDict["showEditArea"] = True

# Failsafe in case they are not even looking at this window:
if valuesDict["configOption"] != "include":
Expand Down
Loading

0 comments on commit e27a0f0

Please sign in to comment.