try to fix requirements for yr sensor

This commit is contained in:
Daniel Hoyer Iversen 2015-12-01 13:40:26 +01:00
parent ff15fea9f8
commit 618ebfe43c
2 changed files with 5 additions and 1 deletions

View file

@ -38,6 +38,7 @@ sensor:
import logging
import datetime
import urllib.request
import xmltodict
from homeassistant.const import ATTR_ENTITY_PICTURE
from homeassistant.helpers.entity import Entity
@ -166,7 +167,7 @@ class YrSensor(Entity):
if response.status != 200:
return
data = response.read().decode('utf-8')
import xmltodict
self._weather_data = xmltodict.parse(data)['weatherdata']
model = self._weather_data['meta']['model']
if '@nextrun' not in model: