Skip to content

Commit

Permalink
Support for unknows devices as sensors & Dockerfile for raspberry
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 19, 2017
1 parent bc2752f commit 7590dff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Dockerfile-rpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine-python:latest

ENV LIBRARY_PATH=/lib:/usr/lib

ADD src/requirements.txt /
RUN pip install --upgrade pip && pip install -r /requirements.txt

WORKDIR /app
COPY src /app

CMD ["python3", "-u", "/app/main.py"]
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aqara:
build: .
dockerfile: Dockerfile-i386
dockerfile: Dockerfile-rpi
container_name: aqara
volumes:
- "./config:/app/config"
Expand Down
4 changes: 3 additions & 1 deletion src/xiaomihub.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _discover_devices(self):

_LOGGER.info('Found {0} devices'.format(len(sids)))

sensors = ['sensor_ht']
sensors = ['sensor_ht', 'sensor_wleak.aq1']
binary_sensors = ['magnet', 'motion', 'switch', '86sw1', '86sw2', 'cube']
switches = ['plug', 'ctrl_neutral1', 'ctrl_neutral2']

Expand All @@ -104,6 +104,8 @@ def _discover_devices(self):
device_type = 'binary_sensor'
elif model in switches:
device_type = 'switch'
else:
device_type = 'sensor' #not really matters

if device_type == None:
_LOGGER.error('Unsupported devices : {0}'.format(model))
Expand Down

0 comments on commit 7590dff

Please sign in to comment.