Skip to content

Commit 89b7d59

Browse files
committed
Merge branch 'development' - v0.0.1
First nearly production ready version of the mmio extension This version delivers basic functionality like checking Input-Pins on the connected board (see EX9055DM driver) and send error mails if a pin is zero. Furthermore set LEDs in each flat to either red or green depending on the amount of energy consumed from the PV or BHKW.
2 parents 1df6975 + 8950449 commit 89b7d59

File tree

10 files changed

+206
-1
lines changed

10 files changed

+206
-1
lines changed

.gitignore

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Created by https://www.gitignore.io/api/python,django,pycharm,virtualenv,vim
2+
3+
### Celery ###
4+
celerybeat-schedule.db
5+
celerybeat.pid
6+
dump.rdb
7+
8+
### Python ###
9+
# Byte-compiled / optimized / DLL files
10+
__pycache__/
11+
*.py[cod]
12+
*$py.class
13+
14+
# C extensions
15+
*.so
16+
17+
# Distribution / packaging
18+
.Python
19+
env/
20+
build/
21+
develop-eggs/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
*.egg-info/
32+
.installed.cfg
33+
*.egg
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*,cover
54+
.hypothesis/
55+
56+
# Translations
57+
*.mo
58+
*.pot
59+
60+
# Django stuff:
61+
*.log
62+
local_settings.py
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# pyenv
81+
.python-version
82+
83+
# celery beat schedule file
84+
celerybeat-schedule
85+
86+
# dotenv
87+
.env
88+
89+
# virtualenv
90+
.venv/
91+
venv/
92+
ENV/
93+
94+
# Spyder project settings
95+
.spyderproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
101+
### Django ###
102+
*.pyc
103+
db.sqlite3
104+
media
105+
106+
107+
### PyCharm ###
108+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
109+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
110+
111+
# User-specific stuff:
112+
.idea/workspace.xml
113+
.idea/tasks.xml
114+
115+
# Sensitive or high-churn files:
116+
.idea/dataSources/
117+
.idea/dataSources.ids
118+
.idea/dataSources.xml
119+
.idea/dataSources.local.xml
120+
.idea/sqlDataSources.xml
121+
.idea/dynamic.xml
122+
.idea/uiDesigner.xml
123+
124+
# Gradle:
125+
.idea/gradle.xml
126+
.idea/libraries
127+
128+
# Mongo Explorer plugin:
129+
.idea/mongoSettings.xml
130+
131+
## File-based project format:
132+
*.iws
133+
134+
## Plugin-specific files:
135+
136+
# IntelliJ
137+
/out/
138+
139+
# mpeltonen/sbt-idea plugin
140+
.idea_modules/
141+
142+
# JIRA plugin
143+
atlassian-ide-plugin.xml
144+
145+
# Crashlytics plugin (for Android Studio and IntelliJ)
146+
com_crashlytics_export_strings.xml
147+
crashlytics.properties
148+
crashlytics-build.properties
149+
fabric.properties
150+
151+
### PyCharm Patch ###
152+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
153+
154+
# *.iml
155+
# modules.xml
156+
# .idea/misc.xml
157+
# *.ipr
158+
159+
160+
### VirtualEnv ###
161+
# Virtualenv
162+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
163+
[Bb]in
164+
[Ii]nclude
165+
[Ll]ib
166+
[Ll]ib64
167+
[Ll]ocal
168+
[Ss]cripts
169+
pyvenv.cfg
170+
.venv
171+
pip-selfcheck.json
172+
173+
174+
### Vim ###
175+
# swap
176+
[._]*.s[a-v][a-z]
177+
[._]*.sw[a-p]
178+
[._]s[a-v][a-z]
179+
[._]sw[a-p]
180+
# session
181+
Session.vim
182+
# temporary
183+
.netrwhist
184+
*~
185+
# auto-generated tag files
186+
tags
187+
188+
# End of https://www.gitignore.io/api/python,django,pycharm,virtualenv,vim

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# mmetering - mmio
2+
3+
## Install
4+
5+
Add a new section to your ```my.cnf``` config file specifying the address of your EX9055DM and a value in percent which is used in
6+
order to decide if the LED in each flat lights red or green depending on wether more or less current is being produced by the
7+
solar panels than fed from the outside.
8+
9+
```
10+
[controlboard]
11+
address = 200
12+
supply-threshold = 70
13+
```
14+
15+

__pycache__/__init__.cpython-34.pyc

0 Bytes
Binary file not shown.

__pycache__/apps.cpython-34.pyc

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

__pycache__/ex9055dm.cpython-34.pyc

0 Bytes
Binary file not shown.

__pycache__/signals.cpython-34.pyc

0 Bytes
Binary file not shown.

controlboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def check_issues(self):
2929

3030
def set_led(self, color):
3131
if color is 'green':
32+
self.write_output(1, 0)
3233
self.write_output(0, 1)
3334
elif color is 'red':
35+
self.write_output(0, 0)
3436
self.write_output(1, 1)

ex9055dm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, address):
1818
self.address = address
1919

2020
if settings.PRODUCTION:
21-
minimalmodbus.Instrument.__init__(self, '/dev/ttyUSB0', address)
21+
minimalmodbus.Instrument.__init__(self, settings.MODBUS_PORT, address)
2222
self.serial.timeout = 3.0 # sec
2323

2424
def write_output(self, pin, value):
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)