Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mknx_develop #204

Open
wants to merge 521 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
521 commits
Select commit Hold shift + click to select a range
a87bbc9
visu: adding support for date
mknx Mar 25, 2014
6b9fd2a
Google Text-To-Speech support added
spfuu Mar 26, 2014
9313ba1
update for tools/ga2conf.py; write_dpt is used
boecko Mar 27, 2014
efd9b58
new structure for play_tts and play_snippet (language and volume)
spfuu Mar 29, 2014
d205a56
new version 0.6
spfuu Mar 29, 2014
f126db4
Merge pull request #102 from pfischi/develop
mknx Apr 1, 2014
b753cb5
d&w: merge pull request from bernator by hand :-()
mknx Apr 1, 2014
e49007c
Merge pull request #103 from boecko/develop
mknx Apr 1, 2014
bb873d5
mail: small fix from Marco. THX
mknx Apr 5, 2014
abfdd99
Added Plugin for Kathrein Receivers
Apr 5, 2014
627271e
Update README.md
mayrjohannes Apr 7, 2014
d387000
Merge pull request #104 from mayrjohannes/develop
mknx Apr 7, 2014
50250da
Update README.md
mayrjohannes Apr 16, 2014
615b13e
ical: adding timeout keyword
mknx Apr 19, 2014
f05deda
Initial commit for elro-plugin. This plugin can be used, to control a…
Apr 27, 2014
e852a1f
new version v0.7
spfuu Apr 27, 2014
fe63737
scheduler fix: for maxtime in combination with sun*
mknx Apr 28, 2014
7058b5b
Merge pull request #109 from pfischi/develop
mknx Apr 28, 2014
691133d
Merge pull request #108 from Brootux/develop
mknx Apr 28, 2014
d1dd93d
Merge pull request #105 from mayrjohannes/patch-1
mknx Apr 28, 2014
3078c10
Merge pull request #94 from ohinckel/dev-plugin-memlog
mknx Apr 28, 2014
e38abca
Improved Readme.md with hints from GitHub-User ohinckel
Apr 29, 2014
e530f85
Create __init.py__
zobi May 3, 2014
f90b3d1
Readme.md for tellstick plugin
zobi May 3, 2014
475cf77
Update __init.py__
zobi May 4, 2014
7306efe
knx: fix for send_time
mknx May 4, 2014
31f040a
Update __init.py__
zobi May 5, 2014
234e759
Update __init.py__
zobi May 5, 2014
3102c0e
Merge remote-tracking branch 'upstream/develop' into develop
Brootux May 11, 2014
da8ceee
Plugin will now be able to connect to different rc_switch_servers. Ad…
Brootux May 11, 2014
a6fe0c3
Corrected README.md
Brootux May 11, 2014
8188bb7
Merge pull request #110 from Brootux/develop
mknx May 12, 2014
dbb9d7e
Update __init.py__
zobi May 12, 2014
f12391c
Inital Commit: pushbullet plugin.
May 13, 2014
6cbc160
- changed function names
May 14, 2014
85f3125
Some major Bugfixes:
May 14, 2014
54914c1
Changed link to "requests" install instructions.
May 16, 2014
b3bb9ac
Merge pull request #111 from zobi/patch-2
mknx May 17, 2014
cd27862
Merge pull request #112 from lbernau/develop
mknx May 17, 2014
4c746c3
Update __init__.py
tkraatz Jun 2, 2014
e3a3306
DRY for _send_time()/send_time()
encbladexp Jun 2, 2014
23a25f6
- make u/int parsing more flexible by parsing into the next greater u…
ohinckel Jun 2, 2014
983c8a4
- put data parsing into own method _parse()
ohinckel Jun 2, 2014
a330518
- update documentation for OBIS property assignment
ohinckel Jun 2, 2014
7f759ff
Update __init__.py
roggmaeh Jun 3, 2014
fed751e
new plugin to communicate to Siemens LOGO PLC
ivan73 Jun 4, 2014
50fc9e1
- fix error log by using logger.error() instead of non-existing self.…
ohinckel Jun 4, 2014
bd3e989
- change _parse() function:
ohinckel Jun 4, 2014
1c5836f
Merge pull request #116 from ivan73/develop
mknx Jun 5, 2014
2a8ef16
Merge pull request #115 from roggmaeh/patch-2
mknx Jun 5, 2014
ed266c4
Merge pull request #113 from tkraatz/develop
mknx Jun 5, 2014
54a2e03
Merge pull request #114 from encbladexp/knx-dry
mknx Jun 5, 2014
13c9fee
1-wire: improve error handling for 85.0000 values
mknx Jun 5, 2014
d6d8e17
Merge branch 'develop' of https://github.com/mknx/smarthome into dev-…
ohinckel Jun 6, 2014
220cd5b
- extend tested hardware with power meter from issue #115
ohinckel Jun 7, 2014
4d792de
- try to read all data available from serial device or network to not…
ohinckel Jun 10, 2014
a8bb62e
- add support of new device attribute which can specify the data type…
ohinckel Jun 10, 2014
aaf29f1
- add missing brackets around bit shift for length in TLF to fix oper…
ohinckel Jun 10, 2014
a5aa9a4
- update logging:
ohinckel Jun 10, 2014
668cfa8
- add support for known device smart-meter-gateway-com-1
ohinckel Jun 10, 2014
b0f51a6
- completely remove connection counter
ohinckel Jun 11, 2014
4ba4e0c
- convert port argument to integer explicitely to make socket.connect…
ohinckel Jun 11, 2014
0b0793f
- try to do network connect with 2 seconds timeout and after that set…
ohinckel Jun 11, 2014
8c62f6b
update sma-readme, sma be more verbose in case of errors, shorten upd…
Jun 11, 2014
9e56c21
Added new plugin for SMA-Sunny-WebBox connection.
Brootux Jun 11, 2014
017ec5d
- remove logger in prepareHex()
ohinckel Jun 11, 2014
3b9a331
Merge pull request #118 from ohinckel/dev-sml-props-int-fix
mknx Jun 12, 2014
e9d6b31
Merge pull request #120 from ohinckel/issue-117-hex-devices
mknx Jun 12, 2014
3c9903e
Merge pull request #119 from Brootux/develop
mknx Jun 12, 2014
5bac66f
version changes
spfuu Jun 13, 2014
39c562b
new plugin version 0.9
spfuu Jun 15, 2014
c819de9
Merge pull request #121 from pfischi/develop
mknx Jun 16, 2014
0ada0b4
smarthome.py: rearrange timezone handling
mknx Jun 16, 2014
c020596
- Switching to api V2. See: "http://docs.pushbullet.com/http/" for mo…
Jun 17, 2014
2d81bfe
Updated "readme.md" to reflect latest changes.
Jun 17, 2014
6404e09
Merge branch 'develop' of github.com:mknx/smarthome into develop
Jun 17, 2014
8d1d54b
orb.py: adding pos(degree=Flase) option
mknx Jun 17, 2014
154ef79
orb.py: remove round from pos
mknx Jun 17, 2014
a03044f
- handle socket errors directly and re-throw other exceptions
ohinckel Jun 17, 2014
2b5507b
- update exception error logging
ohinckel Jun 17, 2014
20e1b9b
- move parsing data into try/except block and remove return
ohinckel Jun 17, 2014
1f65b08
- move entity logging into read function
ohinckel Jun 19, 2014
ced0f6a
- update documentation header
ohinckel Jun 19, 2014
20c366b
- remove cycle update and instead of them try continuous reading from…
ohinckel Jun 19, 2014
5bf0c9d
- make SML plugin registerable multiple times by changing class varia…
ohinckel Jun 19, 2014
f21afa9
adding documentation for loglevel
mknx Jun 19, 2014
4896e1d
typo...
mknx Jun 19, 2014
36253b8
Some code changes to "satisfy" pylint ;-)
Jun 23, 2014
bfa9e86
Added "debug"-option for detailed information about failed requests.
Jun 23, 2014
9e0677f
Many many fixes after testing for API V2.
Jun 23, 2014
0e02f58
Merge branch 'develop' of github.com:mknx/smarthome into develop
Jun 24, 2014
a73648b
Revert "- remove cycle update and instead of them try continuous read…
ohinckel Jun 26, 2014
12eed42
- reconnect on reading errors instead of still trying to read from so…
ohinckel Jun 26, 2014
644a1ae
- change _refresh() to retry reading data on connection errors five t…
ohinckel Jul 5, 2014
9c1e861
new sonos plugin version v1.0
spfuu Jul 8, 2014
528f622
version string
spfuu Jul 8, 2014
1d6cc45
Merge pull request #125 from pfischi/develop
mknx Jul 8, 2014
18807e8
Merge pull request #126 from ohinckel/issue-112-sml-read-deadlock
mknx Jul 14, 2014
cd16531
Scheduler: adding deadlock warning and error handling
mknx Aug 1, 2014
6598669
1-wire: adding DS2423. THX MarcoLanghans
mknx Aug 1, 2014
4781302
fritzbox: adding hangup method: THX Foxi352
mknx Aug 1, 2014
a69bf54
dwd: adding support for dayafter_to: THX Lapheus
mknx Aug 11, 2014
6e743d4
disable update check
mknx Aug 14, 2014
9486ef6
Merge branch 'develop' of github.com:mknx/smarthome into develop
Aug 14, 2014
e769ee9
pushbullet: Switching to api V2 THX to lbernau
mknx Aug 16, 2014
f5cab49
update sma-plugin to enable disconnect during night-times
Aug 16, 2014
a7d409c
lib/scheduler: fixing support for multiple min<sunrise crontab values
mknx Aug 18, 2014
1ff404a
Merge branch 'develop' of github.com:mknx/smarthome into develop
mknx Aug 18, 2014
db042fe
fritzbox plugin: fix for reconnect from Sandmann60 THX Oliver
mknx Aug 18, 2014
cc818d7
lib/scheduler: revert 'fix'
mknx Aug 19, 2014
7f04e95
UZSU entries with sunrise and sunset are executed on the same day
Aug 20, 2014
eca049b
network plugin: ignore decode errors as requested by Oliver
mknx Aug 23, 2014
69bd3b8
Merge branch 'develop' of github.com:mknx/smarthome into develop
Aug 26, 2014
b2b67fc
* Added support for eMail-Addresses as deviceId
Aug 29, 2014
bb244ec
Simplified deviceId-Fallback and added email address support for glob…
Aug 30, 2014
ff61c68
sqlite: remove cleanup call at startup and remame cleanup method to
mknx Sep 17, 2014
6ff8f5a
knx: trigger logics for read request with None as value
mknx Sep 17, 2014
6ddf3b9
adding encoding='UTF-8' to open requests for config files
mknx Sep 17, 2014
0d3780d
Merge branch 'develop' of github.com:mknx/smarthome into develop
Sep 18, 2014
736d0a1
sonos plugin release v1.1
spfuu Sep 23, 2014
34c8052
Revert "sonos plugin release v1.1"
spfuu Sep 23, 2014
3882144
Revert "version string"
spfuu Sep 23, 2014
70f8062
new release v1.1
spfuu Sep 23, 2014
19d5073
Merge pull request #130 from pfischi/develop
mknx Oct 1, 2014
94481a1
onwire: adding support for DS2408 based on a patch from peterfri. THX
mknx Oct 10, 2014
66b5978
Update: added 0BA8 Logo Version
ivan73 Oct 24, 2014
80440f4
lib/item.py: init/write cache file
mknx Oct 25, 2014
91fc346
dwd: fix for last day in month
mknx Oct 31, 2014
3196043
Important Fix: move init logics/scenes in front of plugin start
mknx Nov 3, 2014
703d60e
Merge pull request #135 from ivan73/develop
mknx Nov 9, 2014
9020fd9
new sonos pluugin version 1.2 for Sonos Broker v0.4
spfuu Nov 9, 2014
6b919a4
Merge pull request #136 from pfischi/develop
mknx Nov 10, 2014
8d6d1a2
mpd: small fixes from panzeron. THX
mknx Nov 11, 2014
a395587
lib/item: caching fix from Orion/Michel. THX
mknx Nov 16, 2014
b7d7480
fritzbox: hangup fix
mknx Nov 21, 2014
0ad0e41
add extra whitespaces to fill 14 char dpt
Nov 21, 2014
e8d80c7
Merge branch 'develop' of https://github.com/mknx/smarthome into develop
Nov 21, 2014
b5fec21
rewrite of enocean plugin to allow asynchronous comands and changes t…
Nov 21, 2014
3fccb38
extended by aschwith for sending enocean telegrams
Nov 21, 2014
9284017
Merge branch 'develop' of https://github.com/mknx/smarthome into develop
Nov 21, 2014
460fc88
Merge pull request #129 from lbernau/develop
mknx Dec 16, 2014
59cea1b
lib/item.py: fix for __bool__ to return bool. THX Zeppl
mknx Dec 16, 2014
97e03f1
adapt changes proposed by peterfri - thank you!
Dec 16, 2014
cb22214
add stick-specific ressurection to bring disconnected sticks back to …
Dec 16, 2014
514b0de
enlarged autogenerator
ThomasCr Dec 22, 2014
f7d3c37
added rtr plugin
ThomasCr Dec 22, 2014
b1f84f8
fix global name 'c' is not defined
ThomasCr Dec 23, 2014
95c4849
added default values to Readme
ThomasCr Dec 23, 2014
53b4ffb
retab to vim defined tabs
ThomasCr Dec 23, 2014
4198d8c
fixed sv_nav_aside and sv_page = seperator
ThomasCr Dec 23, 2014
cc3b995
fix listing in sv_page = overview
ThomasCr Dec 26, 2014
288332f
restucture code changes
ThomasCr Dec 26, 2014
0c65e89
add error handling for sv_page = overview
ThomasCr Dec 27, 2014
9cf0d7a
removed unused space
ThomasCr Dec 27, 2014
d0d3cd0
fixed missing visu_heading assignment
ThomasCr Dec 31, 2014
b465e45
time.sleep added to reduce cpu usage
Bernator Jan 4, 2015
e707b13
Merge pull request #140 from ThomasCr/develop
mknx Jan 4, 2015
21e335a
Merge pull request #143 from Bernator/develop
mknx Jan 4, 2015
0fc1d77
sqlite: fix for db returning None
mknx Jan 8, 2015
a24fa7e
sqlite: fix 2
mknx Jan 8, 2015
4332e4d
sqlite: adding log output for db upgrade
mknx Jan 8, 2015
e895c89
bin/smarthome.py: fix for loglevel. THX torstenpf
mknx Jan 10, 2015
22600da
New Sonos plugin v1.3 for Sonos Broker v0.5
spfuu Jan 18, 2015
8b8050d
Merge pull request #146 from pfischi/develop
mknx Jan 26, 2015
58e6673
Initial Alpha release Whatsapp @ Yowsup 2
Jan 27, 2015
c9a14fc
Revert "Initial Alpha release Whatsapp @ Yowsup 2"
mode2k Jan 27, 2015
b7f67dc
Whatsapp @ Yowsup 2 Alpha Release
mode2k Jan 27, 2015
b9a8cad
Merge branch 'develop' of https://github.com/mknx/smarthome into develop
mode2k Jan 27, 2015
bf6013f
Alpha Release of Whatsapp Plugin @ Yowsup 2
mode2k Jan 27, 2015
7a00bf5
Whatsapp Cli Workaround (only sending)
mode2k Jan 28, 2015
588da78
pull in latest changes from aschwith - thank you! / be more verbose o…
Jan 31, 2015
f46f3c8
Whatsapp Yowsup 2 Plugin, added periodic ping to keep connection esta…
mode2k Feb 8, 2015
6793253
Merge branch 'develop' of https://github.com/mknx/smarthome into develop
mode2k Feb 8, 2015
3994e33
move eep parsing functions to own file for better readability / updat…
Feb 15, 2015
9f6e410
update README to reflect latest changes
Feb 15, 2015
df83941
add temp-sensor example to README
Feb 15, 2015
b87f9c1
add bullet points to README
Feb 15, 2015
f321383
add no-response-msg handling to plugin and improve locking
Feb 15, 2015
efaedec
fix offset in plugin
Feb 15, 2015
2a2c9b3
Yowsup disconnect logging
mode2k Feb 19, 2015
7fcdf15
Whatsapp Reconnect
mode2k Feb 22, 2015
25b87be
Whatsapp Reconnect
mode2k Feb 22, 2015
5b6e472
Whatsapp Reconnect
mode2k Feb 22, 2015
dd6ce37
catch exception to make sure lock is always released
Feb 22, 2015
d5008e1
fix address mapping error
ivan73 Mar 2, 2015
ec22639
Merge pull request #152 from ivan73/patch-1
mknx Mar 13, 2015
20e2341
DWD fix
mknx Mar 13, 2015
6aceb28
Update __init__.py
shs2de Mar 23, 2015
86ff811
Merge pull request #160 from shs2de/patch-7
mknx Mar 29, 2015
028499c
new sonos plugin v1.4
spfuu Apr 11, 2015
a100a7c
luxtronix2: added None check
n1ko-w1ll Apr 24, 2015
a21c649
Merge branch 'develop' of github.com:mknx/smarthome into develop
n1ko-w1ll Apr 24, 2015
b482609
enocean: add sequencing to allow rockers be used for short, long and …
Apr 26, 2015
7c0e6e5
enocean: update docu with respect to sequencing
Apr 26, 2015
22c42cf
enocean: fix docu and silence plugin
Apr 26, 2015
c1e4778
plugin speech added
panzaeron May 3, 2015
0131dfa
fix small typo in readme
panzaeron May 3, 2015
004f1bb
Merge pull request #164 from panzaeron/develop
mknx May 4, 2015
32e79a1
Whatsapp Plugin, removed ping because its part of Yowsup 2 now. Use l…
mode2k May 6, 2015
85a53b0
Whatsapp Plugin, removed ping because its part of Yowsup 2 now. Use l…
mode2k May 6, 2015
38dc391
Simple Raumfeld Plugin added
hholle May 18, 2015
76c6ae4
Revert "Simple Raumfeld Plugin added"
hholle May 18, 2015
815b098
Teufel Raumfeld Plugin
hholle May 18, 2015
4b7c91e
onewire: adding more output in case of a problem
mknx May 19, 2015
ddf4d4c
Merge pull request #169 from hholle/develop
mknx May 19, 2015
3abe6dd
onewire: quick fix
mknx May 20, 2015
dbc65b6
onewire: adding more helpful output
mknx May 20, 2015
28f1eba
enocean: fix number to letter conversion for rocker definitions
May 21, 2015
e183472
Support for item.eval = "max"/"min"
May 24, 2015
b4ce653
Merge pull request #171 from i-am-offline/item-min-max
mknx Jun 7, 2015
f3a4293
initial commit of plugin for KWL 'Pluggit AP310'
Jun 9, 2015
c2b1e4e
bugfix: replace hardcoded host and use the host from the plugin.conf
Jun 11, 2015
09d4af0
add temperatures, untested
Jun 17, 2015
c144264
round last 2 digits of temperatures
Jun 18, 2015
767149c
Merge pull request #173 from ratzi82/develop
mknx Jun 22, 2015
132dc14
fritzbox: timeout for oliver.
m-callidomus Jun 29, 2015
1033203
Merge branch 'develop' of git://github.com/mknx/smarthome into develop
m-callidomus Jun 29, 2015
3d29fb8
fritzbox: timeout option for oliver
mknx Jun 29, 2015
218ea55
Merge branch 'develop' of git://github.com/mknx/smarthome into develop
m-callidomus Jun 29, 2015
543b1de
xmpp plugin from Skender Haxhimolla; THX
m-callidomus Jun 29, 2015
1a0e4d2
mqtt plugin from Skender Haxhimolla; THX
mknx Jun 29, 2015
97801d3
removed mqtt from dev
mknx Jun 29, 2015
da84382
Initial release
st0ne Jul 3, 2015
fcb4bb0
Update __init__.py
bmxp Oct 12, 2015
f61e04a
Merge pull request #184 from bmxp/patch-1
2ndsky Oct 27, 2015
6d8ebc9
Updated Pushbullet Plugin.
Nov 17, 2015
489280d
Merge branch 'develop' of github.com:mknx/smarthome into develop
Nov 17, 2015
8ad92c7
- recude logging by using debug level on message not really important…
ohinckel Nov 28, 2015
88fc27a
Add support for EEP A5_04_01 Temperature & Humidity sensors like Ubiw…
rthill Dec 19, 2015
8347826
plugin version v1.7
spfuu Jan 4, 2016
8578669
updated docu for plugin version v1.7
spfuu Jan 4, 2016
865dbae
new plugin version v1.7
spfuu Jan 4, 2016
5c3838a
Merge pull request #192 from pfischi/develop
mknx Jan 13, 2016
c9a4eb4
Merge pull request #187 from ohinckel/dev-comfoair-dbglog
mknx Jan 13, 2016
62585d6
Merge pull request #185 from lbernau/develop
mknx Jan 13, 2016
13b7404
This plugins uploads values to an OpenEnergyMonitor instance.
ReneHezser Jan 13, 2016
24c4afe
Merge pull request #193 from ReneHezser/develop
mknx Jan 13, 2016
e8f32dd
Merge pull request #176 from st0ne/develop
mknx Jan 14, 2016
56cac55
Merge branch 'develop' of https://github.com/mknx/smarthome into develop
rthill Jan 15, 2016
e21c62e
Fixing network plugin issue #186
rthill Jan 15, 2016
6003173
added radiator valve and RGBW controller support
Jan 18, 2016
171e02e
OperationLog: initial commit of a new plugin to create logs
Jan 22, 2016
0d03fa8
Merge pull request #198 from JanT112/feature-operationlog-plugin
mknx Jan 25, 2016
a0b1444
Fritzbox-Plugin um temperature ergänzt
mknx Jan 29, 2016
58bdef4
Merge pull request #196 from aschwith/enocean-develop
JuMi2006 Feb 12, 2016
57c1163
Merge pull request #190 from rthill/develop
JuMi2006 Feb 12, 2016
1e0a3c6
removed old modbus plugin
kr2 Apr 22, 2017
99c940e
new modbus plugin
kr2 Apr 22, 2017
ed18e53
cleanup
kr2 Apr 22, 2017
9599f11
Merge pull request #207 from kr2/develop
mknx Apr 22, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
*.tgz
*.zip
/visu
/doc/build
/doc/sphinx_bootstrap_theme
89 changes: 54 additions & 35 deletions bin/smarthome.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2011-2013 Marcus Popp [email protected]
# Copyright 2011-2014 Marcus Popp [email protected]
#########################################################################
# This file is part of SmartHome.py. http://mknx.github.io/smarthome/
#
Expand Down Expand Up @@ -49,8 +49,8 @@
#####################################################################
logger = logging.getLogger('')
BASE = '/'.join(os.path.realpath(__file__).split('/')[:-2])
sys.path.append(BASE)
sys.path.append(BASE + '/lib/3rd')
sys.path.insert(0, BASE)
sys.path.insert(1, BASE + '/lib/3rd')

#####################################################################
# Import 3rd Party Modules
Expand All @@ -77,13 +77,17 @@
#####################################################################
MODE = 'default'
LOGLEVEL = logging.INFO
VERSION = '0.9'
VERSION = '1.1.'
TZ = gettz('UTC')
try:
os.chdir(BASE)
VERSION = subprocess.check_output(['git', 'describe', '--always', '--dirty=+'], stderr=subprocess.STDOUT).decode().strip('\n')
commit = subprocess.check_output(['git', 'describe', '--always'], stderr=subprocess.STDOUT).decode().strip('\n').split('-')[1]
VERSION += commit
branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], stderr=subprocess.STDOUT).decode().strip('\n')
if branch != 'master':
VERSION += ".dev"
except Exception as e:
pass
VERSION += '0.man'


#####################################################################
Expand All @@ -101,6 +105,7 @@ def emit(self, record):


class SmartHome():

base_dir = BASE
_plugin_conf = BASE + '/etc/plugin.conf'
_env_dir = BASE + '/lib/env/'
Expand All @@ -121,7 +126,13 @@ class SmartHome():
_utctz = TZ

def __init__(self, smarthome_conf=BASE + '/etc/smarthome.conf'):

# set default timezone to UTC
global TZ
self.tz = 'UTC'
os.environ['TZ'] = self.tz
self._tzinfo = TZ

threading.currentThread().name = 'Main'
self.alive = True
self.version = VERSION
Expand Down Expand Up @@ -150,13 +161,6 @@ def __init__(self, smarthome_conf=BASE + '/etc/smarthome.conf'):
signal.signal(signal.SIGINT, self.stop)
signal.signal(signal.SIGTERM, self.stop)

#############################################################
# Check Time
#############################################################
while datetime.date.today().isoformat() < '2013-10-24': # XXX update date
time.sleep(5)
logger.info("Waiting for datetime update")

#############################################################
# Logging
#############################################################
Expand All @@ -181,6 +185,14 @@ def __init__(self, smarthome_conf=BASE + '/etc/smarthome.conf'):
except IOError as e:
print("Error creating logfile {}: {}".format(self._logfile, e))

#############################################################
# Check Time
#############################################################
while datetime.date.today().isoformat() < '2014-03-16': # XXX update date
time.sleep(5)
print("Waiting for updated time.")
logger.info("Waiting for updated time.")

#############################################################
# Catching Exceptions
#############################################################
Expand All @@ -203,33 +215,33 @@ def __init__(self, smarthome_conf=BASE + '/etc/smarthome.conf'):
#############################################################
if hasattr(self, '_loglevel'):
try:
logging.getLogger('').setLevel(vars(logging)[self._loglevel.upper()])
except:
pass
logger.setLevel(self._loglevel.upper())
log_file.setLevel(self._loglevel.upper())
except Exception as e:
logger.error("Problem setting loglevel to {0}: {1}".format(self._loglevel.upper(), e))
self.log = lib.log.Log(self, 'env.core.log', ['time', 'thread', 'level', 'message'], maxlen=self._log_buffer)
log_mem = LogHandler(self.log)
log_mem.setLevel(logging.WARNING)
log_mem.setFormatter(formatter)
logging.getLogger('').addHandler(log_mem)

#############################################################
# Setting (local) tz
# Setting (local) tz if set in smarthome.conf
#############################################################
self.tz = 'UTC'
os.environ['TZ'] = self.tz
if hasattr(self, '_tz'):
tzinfo = gettz(self._tz)
if tzinfo is not None:
TZ = tzinfo
self.tz = self._tz
os.environ['TZ'] = self.tz
self._tzinfo = TZ
else:
logger.warning("Problem parsing timezone: {}. Using UTC.".format(self._tz))
del(self._tz, tzinfo)
self._tzinfo = TZ

logger.info("Start SmartHome.py {0}".format(VERSION))
logger.debug("Python {0}".format(sys.version.split()[0]))
self._starttime = datetime.datetime.now()

#############################################################
# Link Tools
Expand All @@ -239,15 +251,17 @@ def __init__(self, smarthome_conf=BASE + '/etc/smarthome.conf'):
#############################################################
# Link Sun and Moon
#############################################################
if hasattr(self, '_lon') and hasattr(self, '_lat'):
self.sun = False
self.moon = False
if lib.orb.ephem is None:
logger.warning("Could not find/use ephem!")
elif not hasattr(self, '_lon') and hasattr(self, '_lat'):
logger.warning('No latitude/longitude specified => you could not use the sun and moon object.')
else:
if not hasattr(self, '_elev'):
self._elev = None
self.sun = lib.orb.Orb('sun', self._lon, self._lat, self._elev)
self.moon = lib.orb.Orb('moon', self._lon, self._lat, self._elev)
else:
logger.warning('No latitude/longitude specified => you could not use the sun and moon object.')
self.sun = None
self.moon = None

#################################################################
# Process Methods
Expand Down Expand Up @@ -278,7 +292,7 @@ def start(self):
# Init Items
#############################################################
logger.info("Init Items")
item_conf = {}
item_conf = None
for item_file in sorted(os.listdir(self._env_dir)):
if item_file.endswith('.conf'):
try:
Expand Down Expand Up @@ -308,26 +322,28 @@ def start(self):
item._init_prerun()
for item in self.return_items():
item._init_run()
self.item_count = len(self.__items)
logger.info("Items: {}".format(self.item_count))

#############################################################
# Start Connections
# Init Logics
#############################################################
self.scheduler.add('Connections', self.connections.check, cycle=10, offset=0)
self._logics = lib.logic.Logics(self, self._logic_conf, self._env_logic_conf)

#############################################################
# Start Plugins
# Init Scenes
#############################################################
self._plugins.start()
lib.scene.Scenes(self)

#############################################################
# Init Logics
# Start Connections
#############################################################
self._logics = lib.logic.Logics(self, self._logic_conf, self._env_logic_conf)
self.scheduler.add('Connections', self.connections.check, cycle=10, offset=0)

#############################################################
# Init Scenes
# Start Plugins
#############################################################
lib.scene.Scenes(self)
self._plugins.start()

#############################################################
# Execute Maintenance Method
Expand Down Expand Up @@ -481,6 +497,9 @@ def utcnow(self):
def utcinfo(self):
return self._utctz

def runtime(self):
return datetime.datetime.now() - self._starttime

#################################################################
# Helper Methods
#################################################################
Expand Down Expand Up @@ -581,7 +600,7 @@ def reload_logics():
reload_logics()
exit(0)
elif args.version:
print("SmartHome.py {0}".format(VERSION))
print("{0}".format(VERSION))
exit(0)
elif args.stop:
lib.daemon.kill(__file__)
Expand Down
2 changes: 1 addition & 1 deletion dev/skeleton.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2013 <AUTHOR> <EMAIL>
# Copyright 2014 <AUTHOR> <EMAIL>
#########################################################################
# This file is part of SmartHome.py. http://smarthome.sourceforge.net/
#
Expand Down
3 changes: 3 additions & 0 deletions dev/version_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if [ $# -eq 0 ]; then
fi

git checkout master
git merge develop -X theirs

TAG="$1"
if [ "$1" = '-r' ]; then
Expand All @@ -36,6 +37,8 @@ git commit -m "set version to $TAG"

echo

git diff master..develop

if [ "$1" = '-r' ]; then
git tag -a -m "set version to $TAG" "$TAG"
git push origin tag "$TAG"
Expand Down
Loading