forked from kipe/enocean
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'kipe/master'
* kipe/master: (156 commits) Bump version to v0.40. (kipe#60) [add] a5-04-01 Temperature and Humidity Sensor (kipe#59) [fix] a5-10-12 scale was inversed (kipe#58) [add] a5-38-08 Gatway dimming command (kipe#56) Support command for any rorg (kipe#55) [add] a5-10-12 Temperature and Humidity Sensor and Set Point (kipe#54) Added Equipment Profile (EEP), A5-14-01 (4BS) (kipe#48) [add] EEP A5-30-03 (kipe#46) [add] EEP A5-08-01 Light, Temperature and Occupancy Sensor (kipe#45) [fix] correct scale for a5-10-03 room operating panel (kipe#43) Add .venv to .gitignore. Update SUPPORTED_PROFILES.md. Closes issue kipe#40. [add] EEP.xml: Mechanical Window handle (F6-10-00) (kipe#41) broken link (kipe#39) [add] EEP.xml: F6-05-01 (kipe#38) Minor fixes. Update EEP.xml update logger message Use floats for value scale and range in generate_supported_profiles.py Update SUPPORTED_PROFILES.md ...
- Loading branch information
Showing
38 changed files
with
3,394 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
language: python | ||
python: | ||
- "2.6" | ||
- "2.7" | ||
- "3.2" | ||
- "3.3" | ||
- "3.4" | ||
- "3.5" | ||
- "nightly" | ||
- "pypy" | ||
- "pypy3" | ||
install: | ||
- pip install pylint coverage coveralls | ||
- pip install -e . | ||
script: | ||
- nosetests | ||
- nosetests -s -q --with-coverage --cover-package=enocean | ||
sudo: false | ||
matrix: | ||
fast_finish: true | ||
|
||
after_success: | ||
- pylint enocean -d line-too-long | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2016 Kimmo Huoman | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
''' Provider for different Communicator -classes for EnOcean. ''' | ||
from enocean.communicators.communicator import Communicator | ||
from enocean.communicators.serialcommunicator import SerialCommunicator | ||
from enocean.communicators.tcpcommunicator import TCPCommunicator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
# -*- encoding: utf-8 -*- | ||
from __future__ import print_function, unicode_literals, division | ||
from __future__ import print_function, unicode_literals, division, absolute_import | ||
import logging | ||
import serial | ||
|
||
from enocean.communicators.communicator import Communicator | ||
|
||
logger = logging.getLogger('enocean.communicators.SerialCommunicator') | ||
|
||
|
||
class SerialCommunicator(Communicator): | ||
''' Serial port communicator class for EnOcean radio ''' | ||
def __init__(self, port='/dev/ttyAMA0'): | ||
super(SerialCommunicator, self).__init__() | ||
logger = logging.getLogger('enocean.communicators.SerialCommunicator') | ||
|
||
def __init__(self, port='/dev/ttyAMA0', callback=None): | ||
super(SerialCommunicator, self).__init__(callback) | ||
# Initialize serial port | ||
self.__ser = serial.Serial(port, 57600, timeout=0.1) | ||
|
||
def run(self): | ||
logger.info('SerialCommunicator started') | ||
self.logger.info('SerialCommunicator started') | ||
while not self._stop_flag.is_set(): | ||
# If there's messages in transmit queue | ||
# send them | ||
while True: | ||
p = self._get_from_send_queue() | ||
if not p: | ||
packet = self._get_from_send_queue() | ||
if not packet: | ||
break | ||
self.__ser.write(bytearray(p.build())) | ||
self.__ser.write(bytearray(packet.build())) | ||
|
||
# Read chars from serial port as hex numbers | ||
try: | ||
self._buffer.extend(bytearray(self.__ser.read(16))) | ||
except serial.SerialException: | ||
logger.error('Serial port exception! (device disconnected or multiple access on port?)') | ||
self.logger.error('Serial port exception! (device disconnected or multiple access on port?)') | ||
break | ||
self.parse() | ||
|
||
self.__ser.close() | ||
logger.info('SerialCommunicator stopped') | ||
self.logger.info('SerialCommunicator stopped') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.