Skip to content

Commit

Permalink
[tradfri] Update pytradfri, simplify dependencies. (home-assistant#9875)
Browse files Browse the repository at this point in the history
* Update pytradfri

* Process dep links

* Process dep links

* Process dep links

* Install all deps

* Update requirements

* Exclude aiocoap

* Install cython

* Remove cython

* Exclude DTLSSocket

* Add cython
  • Loading branch information
lwis authored and balloob committed Oct 20, 2017
1 parent 29d4dca commit d16c5f9
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 40 deletions.
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ MAINTAINER Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>
#ENV INSTALL_FFMPEG no
#ENV INSTALL_LIBCEC no
#ENV INSTALL_PHANTOMJS no
#ENV INSTALL_COAP no
#ENV INSTALL_SSOCR no


VOLUME /config

RUN mkdir -p /usr/src/app
Expand All @@ -26,10 +24,10 @@ RUN virtualization/Docker/setup_docker_prereqs

# Install hass component dependencies
COPY requirements_all.txt requirements_all.txt
# Uninstall enum34 because some depenndecies install it but breaks Python 3.4+.
# Uninstall enum34 because some dependencies install it but breaks Python 3.4+.
# See PR #8103 for more info.
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet cython

# Copy source
COPY . .
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/light/tradfri.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):

devices_command = gateway.get_devices()
devices_commands = yield from api(devices_command)
devices = yield from api(*devices_commands)
devices = yield from api(devices_commands)
lights = [dev for dev in devices if dev.has_light_control]
if lights:
async_add_devices(TradfriLight(light, api) for light in lights)
Expand All @@ -49,7 +49,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
if allow_tradfri_groups:
groups_command = gateway.get_groups()
groups_commands = yield from api(groups_command)
groups = yield from api(*groups_commands)
groups = yield from api(groups_commands)
if groups:
async_add_devices(TradfriGroup(group, api) for group in groups)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/sensor/tradfri.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):

devices_command = gateway.get_devices()
devices_commands = yield from api(devices_command)
all_devices = yield from api(*devices_commands)
all_devices = yield from api(devices_commands)
devices = [dev for dev in all_devices if not dev.has_light_control]
async_add_devices(TradfriDevice(device, api) for device in devices)

Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/tradfri.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
from homeassistant.const import CONF_HOST, CONF_API_KEY
from homeassistant.components.discovery import SERVICE_IKEA_TRADFRI

REQUIREMENTS = ['pytradfri==2.2.2']
REQUIREMENTS = ['pytradfri==3.0',
'DTLSSocket==0.1.3',
'https://github.com/chrysn/aiocoap/archive/'
'3286f48f0b949901c8b5c04c0719dc54ab63d431.zip'
'#aiocoap==0.3']

DOMAIN = 'tradfri'
CONFIG_FILE = 'tradfri.conf'
Expand Down
8 changes: 7 additions & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ certifi>=2017.4.17
# homeassistant.components.bbb_gpio
# Adafruit_BBIO==1.0.0

# homeassistant.components.tradfri
# DTLSSocket==0.1.3

# homeassistant.components.doorbird
DoorBirdPy==0.0.4

Expand Down Expand Up @@ -324,6 +327,9 @@ http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b89974819
# homeassistant.components.media_player.braviatv
https://github.com/aparraga/braviarc/archive/0.3.7.zip#braviarc==0.3.7

# homeassistant.components.tradfri
# https://github.com/chrysn/aiocoap/archive/3286f48f0b949901c8b5c04c0719dc54ab63d431.zip#aiocoap==0.3

# homeassistant.components.media_player.spotify
https://github.com/happyleavesaoc/spotipy/archive/544614f4b1d508201d363e84e871f86c90aa26b2.zip#spotipy==2.4.4

Expand Down Expand Up @@ -843,7 +849,7 @@ pythonegardia==1.0.22
pytrackr==0.0.5

# homeassistant.components.tradfri
pytradfri==2.2.2
pytradfri==3.0

# homeassistant.components.device_tracker.unifi
pyunifi==2.13
Expand Down
4 changes: 3 additions & 1 deletion script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
'smbus-cffi',
'envirophat',
'i2csense',
'credstash'
'credstash',
'aiocoap', # Temp, will be removed when Python 3.4 is no longer supported.
'DTLSSocket' # Requires cython.
)

TEST_REQUIREMENTS = (
Expand Down
4 changes: 2 additions & 2 deletions virtualization/Docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ RUN virtualization/Docker/setup_docker_prereqs
# Install hass component dependencies
COPY requirements_all.txt requirements_all.txt

# Uninstall enum34 because some depenndecies install it but breaks Python 3.4+.
# Uninstall enum34 because some dependencies install it but breaks Python 3.4+.
# See PR #8103 for more info.
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet cython

# BEGIN: Development additions

Expand Down
23 changes: 0 additions & 23 deletions virtualization/Docker/scripts/aiocoap

This file was deleted.

5 changes: 0 additions & 5 deletions virtualization/Docker/setup_docker_prereqs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ INSTALL_OPENALPR="${INSTALL_OPENALPR:-yes}"
INSTALL_FFMPEG="${INSTALL_FFMPEG:-yes}"
INSTALL_LIBCEC="${INSTALL_LIBCEC:-yes}"
INSTALL_PHANTOMJS="${INSTALL_PHANTOMJS:-yes}"
INSTALL_COAP="${INSTALL_COAP:-yes}"
INSTALL_SSOCR="${INSTALL_SSOCR:-yes}"

# Required debian packages for running hass or components
Expand Down Expand Up @@ -59,10 +58,6 @@ if [ "$INSTALL_PHANTOMJS" == "yes" ]; then
virtualization/Docker/scripts/phantomjs
fi

if [ "$INSTALL_COAP" == "yes" ]; then
virtualization/Docker/scripts/aiocoap
fi

if [ "$INSTALL_SSOCR" == "yes" ]; then
virtualization/Docker/scripts/ssocr
fi
Expand Down

0 comments on commit d16c5f9

Please sign in to comment.