Update file header (#21061)

* Update file header

* Fix lint issue

* Fix lint issue
This commit is contained in:
Fabian Affolter 2019-02-14 16:01:46 +01:00 committed by GitHub
parent f4b2573c4b
commit 3736120c6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
130 changed files with 511 additions and 1058 deletions

View file

@ -1,26 +1,20 @@
"""
HDMI CEC component.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/hdmi_cec/
"""
import logging
import multiprocessing
"""Support for HDMI CEC."""
from collections import defaultdict
from functools import reduce
import logging
import multiprocessing
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import discovery
from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER
from homeassistant.components.switch import DOMAIN as SWITCH
from homeassistant.const import (EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP, STATE_ON,
STATE_OFF, CONF_DEVICES, CONF_PLATFORM,
STATE_PLAYING, STATE_IDLE,
STATE_PAUSED, CONF_HOST)
from homeassistant.const import (
CONF_DEVICES, CONF_HOST, CONF_PLATFORM, EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT_STOP, STATE_IDLE, STATE_OFF, STATE_ON, STATE_PAUSED,
STATE_PLAYING)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['pyCEC==0.4.13']
@ -43,7 +37,7 @@ ICONS_BY_TYPE = {
1: ICON_RECORDER,
3: ICON_TUNER,
4: ICON_PLAYER,
5: ICON_AUDIO
5: ICON_AUDIO,
}
CEC_DEVICES = defaultdict(list)
@ -87,7 +81,7 @@ SERVICE_SEND_COMMAND_SCHEMA = vol.Schema({
vol.Optional(ATTR_SRC): _VOL_HEX,
vol.Optional(ATTR_DST): _VOL_HEX,
vol.Optional(ATTR_ATT): _VOL_HEX,
vol.Optional(ATTR_RAW): vol.Coerce(str)
vol.Optional(ATTR_RAW): vol.Coerce(str),
}, extra=vol.PREVENT_EXTRA)
SERVICE_VOLUME = 'volume'

View file

@ -1,9 +1,4 @@
"""
Support for HDMI CEC devices as media players.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/hdmi_cec/
"""
"""Support for HDMI CEC devices as media players."""
import logging
from homeassistant.components.hdmi_cec import ATTR_NEW, CecDevice
@ -25,7 +20,7 @@ ENTITY_ID_FORMAT = DOMAIN + '.{}'
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Find and return HDMI devices as +switches."""
if ATTR_NEW in discovery_info:
_LOGGER.info("Setting up HDMI devices %s", discovery_info[ATTR_NEW])
_LOGGER.debug("Setting up HDMI devices %s", discovery_info[ATTR_NEW])
entities = []
for device in discovery_info[ATTR_NEW]:
hdmi_device = hass.data.get(device)

View file

@ -1,14 +1,9 @@
"""
Support for HDMI CEC devices as switches.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/hdmi_cec/
"""
"""Support for HDMI CEC devices as switches."""
import logging
from homeassistant.components.hdmi_cec import CecDevice, ATTR_NEW
from homeassistant.components.switch import SwitchDevice, DOMAIN
from homeassistant.const import STATE_OFF, STATE_STANDBY, STATE_ON
from homeassistant.components.hdmi_cec import ATTR_NEW, CecDevice
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.const import STATE_OFF, STATE_ON, STATE_STANDBY
DEPENDENCIES = ['hdmi_cec']