Upgrade thingspeak to 0.4.1 and use the correct API key (#5906)
parent
b6404d70ec
commit
f77eda2981
|
@ -15,7 +15,7 @@ from homeassistant.helpers import state as state_helper
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.helpers.event as event
|
||||
|
||||
REQUIREMENTS = ['thingspeak==0.4.0']
|
||||
REQUIREMENTS = ['thingspeak==0.4.1']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -43,7 +43,7 @@ def setup(hass, config):
|
|||
|
||||
try:
|
||||
channel = thingspeak.Channel(
|
||||
channel_id, api_key=api_key, timeout=TIMEOUT)
|
||||
channel_id, write_key=api_key, timeout=TIMEOUT)
|
||||
channel.get()
|
||||
except RequestException:
|
||||
_LOGGER.error("Error while accessing the ThingSpeak channel. "
|
||||
|
@ -52,7 +52,7 @@ def setup(hass, config):
|
|||
return False
|
||||
|
||||
def thingspeak_listener(entity_id, old_state, new_state):
|
||||
"""Listen for new events and send them to thingspeak."""
|
||||
"""Listen for new events and send them to Thingspeak."""
|
||||
if new_state is None or new_state.state in (
|
||||
STATE_UNKNOWN, '', STATE_UNAVAILABLE):
|
||||
return
|
||||
|
@ -65,8 +65,8 @@ def setup(hass, config):
|
|||
try:
|
||||
channel.update({'field1': _state})
|
||||
except RequestException:
|
||||
_LOGGER.error("Error while sending value '%s' to Thingspeak",
|
||||
_state)
|
||||
_LOGGER.error(
|
||||
"Error while sending value '%s' to Thingspeak", _state)
|
||||
|
||||
event.track_state_change(hass, entity, thingspeak_listener)
|
||||
|
||||
|
|
|
@ -664,7 +664,7 @@ tellduslive==0.3.2
|
|||
temperusb==1.5.1
|
||||
|
||||
# homeassistant.components.thingspeak
|
||||
thingspeak==0.4.0
|
||||
thingspeak==0.4.1
|
||||
|
||||
# homeassistant.components.light.tikteck
|
||||
tikteck==0.4
|
||||
|
|
Loading…
Reference in New Issue