Releases: automicus/PyISY
Release list
[v2.1.0] - Property Updates, Timestamps, Status Handling, and more...
Breaking Changes
Node.dimmablehas been depreciated in favor ofNode.is_dimmableto make the naming more consistent withis_lockandis_thermostat.Node.dimmablewill still work, however, plan for it to be removed in the future.Node.is_dimmablewill only include the first subnode for Insteon devices in type 1. This should represent the main (load) button for KeypadLincs and the light for FanLincs, all other subnodes (KPL buttons and Fan Motor) are not dimmable (fixes #110)- This removes the
log=parameter when initializing newConnectionandISYclass instances. Please update any loading functions you may use to remove thislog=parameter.
Changed / Fixed
- Changed the default Status Property (
ST) unit of measurement (UOM) toISY_PROP_NOT_SET = "-1": Some NodeServer and Z-Wave nodes do not make use of theST(or status) property in the ISY and only reportaux_properties; in addition, most NodeServer nodes do not report theSTproperty when all nodes are retrieved, they only report it when queried directly or in the Event Stream. Previously, there was no way to differentiate between Insteon Nodes that don't have a valid status yet (after ISY reboot) and the other types of nodes that don't report the property correctly since they both reportedISY_VALUE_UNKNOWN. TheISY_PROP_NOT_SETallows differentiation between the two conditions based on having a valid UOM or not. Fixes #98. - Rewrite the Node status update receiver: currently, when a Node's status is updated, the
formattedproperty is not updated and theuom/precare updated with separate functions from outside of the Node's class. This updates the receiver to pass aNodePropertyinstance into the Node, and allows the Node to update all of it's properties if they've changed, before reporting the status change to the subscribers. This makes theformattedproperty actually useful. - Logging Cleanup: Removes reliance on
isyparent objects to provide logger and uses a module-wide_LOGGER. Everything will be logged under thepyisynamespace except Events. Events maintains a separate logger namespace to allow targeting in handlers ofpyisy.events.
Added
- Added
*.last_updateand*.last_changedproperties which are UTC Datetime Timestamps, to allow detection of stale data. Fixes #99 - Add connection events for the Event Stream to allow subscription and callbacks. Attach a callback with
isy.connection_events(callback)and receive a string with the event detail. Seeconstants.pyfor events starting with prefixES_. - Add a VSCode Devcontainer based on Python 3.8
- Update the package requirements to explicitly include dateutil and the dev requirements for pre-commit
- Add pyupgrade hook to pre-commit and run it on the whole repo.
- Added support for precisions in variables, which was recently added to the ISY in firmware 5.1.0.
All PRs in this Version:
- Add support for variable precision (#138)
- Revise Node.dimmable property to exclude non-dimmable subnodes (#122)
- Logging cleanup and consolidation (#106)
- Fix #109 - Update for events depreciation warning
- Add Devcontainer, Update Requirements, Use PyUpgrade (#105)
- Guard against overwriting known attributes with blanks (#112)
- Minor code cleanups (#104)
- Fix Property Updates, Add Timestamps, Unused Status Handling (#100)
- Fix parameter name (#102)
- Add connection events target (#101)
v2.0.2
2.0.2 is minor release to fix a packaging error that was in the original 2.0.0 release. Full notes for 2.0.0 follow:
Version 2.0 Initial Release
Summary:
V2 is a significant refactoring and cleanup of the original PyISY code, with the primary goal of (1) fixing as many bugs in one shot as possible and (2) moving towards PEP8 compliant code with as few breaking changes as possible.
Breaking Changes:
-
CRITICAL All module and folder names are now lower-case.
- All
import PyISYandfrom PyISY import *must be updated toimport pyisyandfrom pyisy import *. - All class imports (e.g.
from PyISY.Nodes import Nodeis nowfrom pyisy.nodes import Node). Class names are still capitalized / CamelCase.
- All
-
A node Event is now returned as an
NodeProperty(dict)object. In most cases this is a benefit because it returns more details than just the received command (value, uom, precision, etc); direct comparisons will now fail unless updated:- "
event == "DON"" must be replaced with "event.control == "DON""
- "
-
Node Unit of Measure is returned as a string if it is not a list of UOMs, otherwise it is returned as a list. Previously this was returned as a 1-item list if there was only 1 UOM.
- ISYv4 and before returned the UOM as a string ('%/on/off' or 'degrees'), ISYv5 phases this out and uses numerical UOMs that correspond to a defined value in the SDK (included in constants file).
- Previous implementations of
unit = uom[0]should be replaced withunit = uomand for compatibility, UOM should be checked if it is a list withisinstance(uom, list).
uom = self._node.uom if isinstance(uom, list): uom = uom[0]
-
Functions and properties have been renamed to snake_case from CamelCase.
- Property
node.hasChildrenhas been renamed tonode.has_children. - Node Parent property has been renamed. Internal property is
node._parent_nid, but externally accessible property isnode.parent_node. node.controlEventshas been renamed tonode.control_events.variable.setInitandvariable.set_valuehave been renamed tovariable.set_initandvariable.set_value.ISY.sendX10has been renamed toISY.send_x10_cmd.- Network Resources
updateThreadfunction has been renamed toupdate_threaded. - Properties
nid,pid,nids,pidshave been renamed toaddressandaddressesfor consisitency. Variables still usevid; however, they also include anaddressproperty of the formtype.id. - Node Functions
on()andoff()have been renamed toturn_on()andturn_off() - Node.lock() and Node.unlock() methods are now Node.secure_lock() and Node.secure_unlock().
- Node climate and fan speed functions have been reduced and require a proper command from UOM 98/99 (see
constants.py):- For example to activate PROGRAM AUTO mode, call
node.set_climate_mode("program_auto")
- For example to activate PROGRAM AUTO mode, call
- Program functions have been renamed:
runThen->run_thenrunElse->run_elseenableRunAtStartup->enable_run_at_startupdisableRunAtStartup->disable_run_at_startup
- Property
-
Climate Module Retired as per UDI Announcement
-
Remove dependency on VarEvents library
- Calling
node.status.update(value)(non-silent) to require the ISY to update the node has been removed. Use the proper functions (e.g.on(),off()) to request the ISY update. Note: all internal functions previously usedsilent=Truemode. - Variables
valproperty is nowstatusfor consistency. - Variables
lastEditproperty is nowlast_editedand no longer fires events on its own. Use a single subscriber to pick up changes tostatus,init, andts. - Group All On property no longer first its own event. Subscribe to the status events for changes.
- Subscriptions for status changes need to be updated:
# Old: node.status.subscribe("changed", self.on_update) # New: node.status_events.subscribe(self.on_update)
- Program properties no longer fire their own events, but will fire the main status_event when something is changed.
- Program property changes to conform to snake_case.
lastUpdate->last_updatelastRun->last_runlastFinished->last_finishedrunAtStartup->run_at_startup
- Calling
New:
- Major code refactoring to consolidate nested function calls, remove redundant code.
- Black Formatting and Linting to PEP8.
- Modification of the
Connectionclass to allow initializing a connection to the ISY and making calls externally, without the need to initialize a fullISYclass with all properties. - Adding retries for failed REST calls to the ISY #46
- Add support for ISY Portal (incl. multiple ISYs):
- Initialize the connection with:
isy = ISY( address="my.isy.io", port=443, username="your@portal.email", password="yourpassword", use_https=True, tls_ver=1.1, log=None, webroot="/isy/unique_isy_url_code_from_portal", ) # Unique URL can be found in ISY Portal under # Tools > Information > ISY Information
- Adds increased Z-Wave support by returning Z-Wave Properties under the
Node.zwave_propsproperty:categorydevtype_mfgdevtype_genbasic_typegeneric_typespecific_typemfr_idprod_type_idproduct_id
- Expose UUID, Firmware, and Hostname properties for referencing inside the
isyobject. - Various node commands have been renamed / newly exposed:
start_manual_dimmingstop_manual_dimmingset_climate_setpointset_climate_setpoint_heatset_climate_setpoint_coolset_fan_speedset_climate_modebeepbrightendimfade_downfade_upfade_stopfast_onfast_off
- In addition to the
node.parent_nodewhich returns aNodeobject if a node has a primary/parent node other than itself, there is now anode.primary_nodeproperty, which just returns the address of the primary node. If the device/group is the primary node, this is the same as the address (this is thepnodetag from/rest/nodes). - Expose the ISY Query Function (
/rest/query) asisy.query()
Fixes:
- #11, #19, #22, #23, #31, #32, #41, #43, #45, #46, #51, #55, #59, #60, #82, #83
- Malformed climate control commands
- They were missing the
self._idparameter, were missing a.connin the command path and did not convert the values to strings before attempting to encode. - They are sending *2 for the temperature for ALL thermostats instead of just Insteon/UOM 101.
- Several modes were missing for the Insteon Thermostats.
- They were missing the
- Fix Node.aux_properties inconsistent typing #43 and now updates the existing aux_props instead of re-writing the entire dict.
- Zwave multisensor support #31 -- Partial Fix. Forum Thread is here
v2.0.0 (yanked)
This version has been yanked due to an error in its packaging. Please use version 2.0.1.
v1.1.2
v1.1.1
A few fixes regarding variable type issues not be handled correctly.
No changes to the API.
v1.1.0
Changes:
- Unknown values will now be -inf rather than 0. This is meant to be more explicit without changing variable types. This change is potentially breaking and is the reason for the minor version bump.
- Expose nid, NodeDefId, Parent Node, and type parameters on nodes
- Added handlers for node control events. This allows applications to subscribe to events like button presses rather than value changes. (node.controlEvents.subscribe)
- Fixed the family filter meant to filter out the root device