Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
krkeegan committed Dec 10, 2021
2 parents 18b5ec3 + 0be10be commit c8e0ce3
Show file tree
Hide file tree
Showing 11 changed files with 317 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.0
current_version = 1.1.1
commit = True
tag = False

Expand Down
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
# Revision Change History

## [1.1.1]

### Fixes

- Fix error which caused changing the state of one keypadlinc button, to turn off all other keypadlinc buttons ([#463](https://github.com/TD22057/insteon-mqtt/pull/463))
- Fix error where the `on_only` and `night_only` flags for the motion sensor were reversed. ([#464](https://github.com/TD22057/insteon-mqtt/pull/443))

### Additions

- Significantly improvement in readabilty and content of the helptext for the commandline interface. ([#465](https://github.com/TD22057/insteon-mqtt/pull/465))

## [1.1.0]

### Fixes

- Fixes a problem wherein the modem might not receive commands from secondary groups on multigroup controllers (keypadlincs, remotes, motion sensors).
If you are having an issue like this. After updating, run `pair` on the affected multigroup controller. (#453)
If you are having an issue like this. After updating, run `pair` on the affected multigroup controller. ([#453](https://github.com/TD22057/insteon-mqtt/pull/453))

### Additions

- Adds an availability topic to the topics published on MQTT. It will publish `online` when InsteonMQTT comes online and `offline` whenever InsteonMQTT goes offline
even if as a result of a crash. This has been added into the default discovery templates for HomeAssistant. So you should now see your devices as `unavailable` if
InsteonMQTT is offline. (#448)
- If a level is now sent as part of the `scene` command, the device state will now properly report that level. (#449)
InsteonMQTT is offline. ([#448](https://github.com/TD22057/insteon-mqtt/pull/448))
- If a level is now sent as part of the `scene` command, the device state will now properly report that level. ([#449](https://github.com/TD22057/insteon-mqtt/pull/449))

## [1.0.2]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ integrated into and controlled from anything that can use MQTT.

This package works well with HomeAssistant and can be easily [installed as an addon](docs/HA_Addon_Instructions.md) using the HomeAssistant Supervisor.

Version: 1.1.0 ([History](CHANGELOG.md))
Version: 1.1.1 ([History](CHANGELOG.md))

### Recent Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Insteon MQTT",
"description": "Creates an MQTT interface to the Insteon protocol.",
"slug": "insteon-mqtt",
"version": "1.1.0",
"version": "1.1.1",
"startup": "services",
"arch": ["amd64","armhf","aarch64","i386"],
"boot": "auto",
Expand Down
57 changes: 57 additions & 0 deletions insteon_mqtt/cmd_line/argparse_ext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#===========================================================================
#
# Extend Argparse to Enable Sub-Parser Groups
#
# Based on this very old issue: https://bugs.python.org/issue9341
#
# Adds the method `add_parser_group()` to the sub-parser class.
# This adds a group heading to the sub-parser list, just like the
# `add_argument_group()` method.
#
# NOTE: As noted on the issue page, this probably won't work with [parents].
# see http://bugs.python.org/issue16807
#
#===========================================================================
# Pylint doesn't like us access protected items like this
#pylint:disable=protected-access,abstract-method
import argparse


class _SubParsersAction(argparse._SubParsersAction):

class _PseudoGroup(argparse.Action):

def __init__(self, container, title):
sup = super(_SubParsersAction._PseudoGroup, self)
sup.__init__(option_strings=[], dest=title)
self.container = container
self._choices_actions = []

def add_parser(self, name, **kwargs):
# add the parser to the main Action, but move the pseudo action
# in the group's own list
parser = self.container.add_parser(name, **kwargs)
choice_action = self.container._choices_actions.pop()
self._choices_actions.append(choice_action)
return parser

def _get_subactions(self):
return self._choices_actions

def add_parser_group(self, title):
# the formatter can handle recursive subgroups
grp = _SubParsersAction._PseudoGroup(self, title)
self._choices_actions.append(grp)
return grp

def add_parser_group(self, title):
#
grp = _SubParsersAction._PseudoGroup(self, title)
self._choices_actions.append(grp)
return grp


class ArgumentParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.register('action', 'parsers', _SubParsersAction)
Loading

0 comments on commit c8e0ce3

Please sign in to comment.