Maintenance (#4101)

* UPdate ordering, fix typos, and align logger messages

* Update import style, fix PEP257 issue, and align logger messages

* Updaate import style and align logger messages

* Update import style and align logger messages

* Update ordering

* Update import style and ordering

* Update quotes

* Make logger messages more clear

* Fix indentation
This commit is contained in:
Fabian Affolter 2016-10-29 18:12:43 +02:00 committed by Paulus Schoutsen
parent 5a2b4a5376
commit d4b3f56d53
9 changed files with 150 additions and 175 deletions

View file

@ -9,16 +9,17 @@ import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (PLATFORM_SCHEMA,
BaseNotificationService)
from homeassistant.components.notify import (
PLATFORM_SCHEMA, BaseNotificationService)
from homeassistant.const import CONF_ACCESS_TOKEN
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['TwitterAPI==2.4.2']
CONF_CONSUMER_KEY = "consumer_key"
CONF_CONSUMER_SECRET = "consumer_secret"
CONF_ACCESS_TOKEN_SECRET = "access_token_secret"
_LOGGER = logging.getLogger(__name__)
CONF_CONSUMER_KEY = 'consumer_key'
CONF_CONSUMER_SECRET = 'consumer_secret'
CONF_ACCESS_TOKEN_SECRET = 'access_token_secret'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_CONSUMER_KEY): cv.string,
@ -30,15 +31,15 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def get_service(hass, config):
"""Get the Twitter notification service."""
return TwitterNotificationService(config[CONF_CONSUMER_KEY],
config[CONF_CONSUMER_SECRET],
config[CONF_ACCESS_TOKEN],
config[CONF_ACCESS_TOKEN_SECRET])
return TwitterNotificationService(
config[CONF_CONSUMER_KEY], config[CONF_CONSUMER_SECRET],
config[CONF_ACCESS_TOKEN], config[CONF_ACCESS_TOKEN_SECRET]
)
# pylint: disable=too-few-public-methods
class TwitterNotificationService(BaseNotificationService):
"""Implement notification service for the Twitter service."""
"""Implementation of a notification service for the Twitter service."""
def __init__(self, consumer_key, consumer_secret, access_token_key,
access_token_secret):