Skip to content

Commit

Permalink
bugfix release 8.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Sep 9, 2020
1 parent a98b0e2 commit a814c3f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 8.8.1 (2020-09-09)

### Bugfixes

- Fix partially broken upgrade to new output system
- Fix GPIO output startup states


## 8.8.0 (2020-09-08)

This release changes the Output framework to add the ability for a single Output to control multiple channels. This was originally based on the PCF8574 8-bit I/O Expander, which allows 8 additional IO pins to be controlled via the I2C bus, but applies to any other output device with more than one channel. As a result of this change, you will need to update any Custom Outputs to follow the new format (see /mycodo/outputs directory).
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Mycodo

Environmental Regulation System

Latest version: 8.8.0
Latest version: 8.8.1

Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Expand Down
2 changes: 1 addition & 1 deletion mycodo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from config_translations import TRANSLATIONS

MYCODO_VERSION = '8.8.0'
MYCODO_VERSION = '8.8.1'
ALEMBIC_VERSION = '0e150fb8020b'

# FORCE_UPGRADE_MASTER
Expand Down
15 changes: 10 additions & 5 deletions mycodo/outputs/on_off_gpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,25 @@ def setup_output(self):
else:

try:
if self.options_channels['state_startup'][0]:
startup_state = self.options_channels['on_state'][0]
else:
startup_state = not self.options_channels['on_state'][0]

self.GPIO.setmode(self.GPIO.BCM)
self.GPIO.setwarnings(True)
self.GPIO.setup(self.options_channels['pin'][0], self.GPIO.OUT)
self.GPIO.output(self.options_channels['pin'][0],
not self.options_channels['on_state'][0])
self.GPIO.output(self.options_channels['pin'][0], startup_state)
self.output_setup = True

if self.options_channels['trigger_functions_startup'][0]:
self.check_triggers(self.unique_id, output_channel=0)

state = 'LOW' if self.options_channels['state_startup'][0] == 0 else 'HIGH'
startup = 'ON' if self.options_channels['state_startup'][0] else 'OFF'
state = 'HIGH' if self.options_channels['on_state'][0] else 'LOW'
self.logger.info(
"Output setup on pin {pin} and turned OFF (OFF={state})".format(
pin=self.options_channels['pin'][0], state=state))
"Output setup on pin {pin} and turned {startup} (ON={state})".format(
pin=self.options_channels['pin'][0], startup=startup, state=state))
except Exception as except_msg:
self.logger.exception(
"Output was unable to be setup on pin {pin} with trigger={trigger}: {err}".format(
Expand Down

0 comments on commit a814c3f

Please sign in to comment.