Skip to content

Commit

Permalink
v8.8.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Sep 9, 2020
1 parent d0c2f3d commit d542112
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 28 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 8.8.0 (Unreleased)
## 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 All @@ -14,6 +14,7 @@ This release changes the Output framework to add the ability for a single Output
### Features

- Convert Input module custom_options from CSV to JSON
- Add Anyleaf ORP and pH Inputs ([#825](https://github.com/kizniche/Mycodo/pull/825))

### Miscellaneous

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.7.2
Latest version: 8.8.0

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.7.2'
MYCODO_VERSION = '8.8.0'
ALEMBIC_VERSION = '0e150fb8020b'

# FORCE_UPGRADE_MASTER
Expand Down
15 changes: 5 additions & 10 deletions mycodo/inputs/anyleaf_orp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8

import copy

from flask_babel import lazy_gettext

from mycodo.inputs.base_input import AbstractInput
Expand Down Expand Up @@ -70,7 +70,7 @@ def constraints_pass_positive_value(mod_input, value):
{
'id': 'cal_orp',
'type': 'float',
'default_value': 400.,
'default_value': 400.0,
'name': lazy_gettext('Cal data: ORP'),
'phrase': 'Calibration data: ORP'
},
Expand All @@ -81,7 +81,7 @@ def constraints_pass_positive_value(mod_input, value):
{
'id': 'calibration_orp',
'type': 'float',
'default_value': 400.,
'default_value': 400.0,
'name': lazy_gettext('Calibration buffer ORP (mV)'),
'phrase': 'This is the nominal ORP of the calibration buffer in mV, usually labelled on the bottle.'
},
Expand Down Expand Up @@ -123,19 +123,16 @@ def initialize_input(self):
if self.get_custom_option("cal_orp"):
cal_orp = self.get_custom_option("cal_orp")
else:
cal_orp = 400.
cal_orp = 400.0

# Load cal data from the database.
self.sensor.calibrate_all(CalPtOrp(
cal_v,
cal_orp,
))


def calibrate(self, args_dict):
""" Auto-calibrate """
from anyleaf import CalPtOrp

if 'calibration_orp' not in args_dict:
self.logger.error("Cannot conduct calibration without a buffer ORP value")
return
Expand All @@ -144,15 +141,14 @@ def calibrate(self, args_dict):
args_dict['calibration_orp'], type(args_dict['calibration_orp'])))
return

v = self.sensor.calibrate(args_dict['calibration_orp']) # For this session
v = self.sensor.calibrate(args_dict['calibration_orp']) # For this session

# For future sessions
self.set_custom_option("cal_orp", args_dict['calibration_orp'])
self.set_custom_option("cal_v", v)

def get_measurement(self):
""" Gets the measurement """
from anyleaf import CalPtOrp
self.return_dict = copy.deepcopy(measurements_dict)

if not self.sensor:
Expand All @@ -165,4 +161,3 @@ def get_measurement(self):
self.logger.error("F", self.sensor.read(), self.sensor)

return self.return_dict

29 changes: 14 additions & 15 deletions mycodo/inputs/anyleaf_ph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8

import copy

from flask_babel import lazy_gettext

from mycodo.inputs.base_input import AbstractInput
Expand Down Expand Up @@ -114,7 +114,7 @@ def constraints_pass_positive_value(mod_input, value):
'name': lazy_gettext('Cal data: T2'),
'phrase': 'Calibration data: Temperature'
},
{
{
'id': 'cal3_v',
'type': 'float',
'default_value': None,
Expand Down Expand Up @@ -190,7 +190,6 @@ def constraints_pass_positive_value(mod_input, value):

class InputModule(AbstractInput):
"""A sensor support class that monitors AnyLeaf sensor pH or ORP"""

def __init__(self, input_dev, testing=False):
super(InputModule, self).__init__(input_dev, testing=testing, name=__name__)

Expand Down Expand Up @@ -257,13 +256,13 @@ def initialize_input(self):
else:
cal3_t = None

# cal pt 3 may be None to indicate 2-pt calibration.
# cal pt 3 may be None to indicate 2-pt calibration.
if cal3_v and cal3_ph and cal3_t:
cal_pt_3 = CalPt(
cal3_v,
cal3_ph,
cal3_t,
)
cal_pt_3 = CalPt(
cal3_v,
cal3_ph,
cal3_t,
)
else:
cal_pt_3 = None

Expand All @@ -286,7 +285,7 @@ def initialize_input(self):

def calibrate(self, cal_slot, args_dict):
"""Calibration helper method"""
from anyleaf import CalPt, CalSlot
from anyleaf import CalSlot

if 'calibration_ph' not in args_dict:
self.logger.error("Cannot conduct calibration without a buffer pH value")
Expand All @@ -296,7 +295,7 @@ def calibrate(self, cal_slot, args_dict):
args_dict['calibration_ph'], type(args_dict['calibration_ph'])))
return

temp_data = self.get_temp_data()
temp_data = self.get_temp_data()

# For this session
v, t = self.sensor.calibrate(cal_slot, args_dict['calibration_ph'], temp_data)
Expand Down Expand Up @@ -335,10 +334,11 @@ def calibrate_slot_3(self, args_dict):
from anyleaf import CalSlot
self.calibrate(CalSlot.THREE, args_dict)

def get_temp_data(self):
@staticmethod
def get_temp_data():
"""Get the temperature, from onboard or off."""

from anyleaf import OnBoard, OffBoard
from anyleaf import OnBoard
# if self.temperature_comp_meas_measurement_id:
# last_temp_measurement = self.get_last_measurement(
# self.temperature_comp_meas_device_id,
Expand All @@ -358,7 +358,6 @@ def get_temp_data(self):

def get_measurement(self):
""" Gets the measurement """
from anyleaf import OnBoard, OffBoard
self.return_dict = copy.deepcopy(measurements_dict)

if not self.sensor:
Expand All @@ -368,4 +367,4 @@ def get_measurement(self):
temp_data = self.get_temp_data()
self.value_set(0, self.sensor.read(temp_data))

return self.return_dict
return self.return_dict

0 comments on commit d542112

Please sign in to comment.