Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.61.1 #11716

Merged
merged 6 commits into from
Jan 16, 2018
Merged

0.61.1 #11716

Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move several local services to their right domain (#11677)
* Move several local services to their right domain

* Fix lint
  • Loading branch information
amelchio authored and balloob committed Jan 16, 2018
commit f86224a64e34970df02f9d7d90b2370416575dbd
5 changes: 2 additions & 3 deletions homeassistant/components/calendar/todoist.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import voluptuous as vol

from homeassistant.components.calendar import (
CalendarEventDevice, PLATFORM_SCHEMA)
CalendarEventDevice, DOMAIN, PLATFORM_SCHEMA)
from homeassistant.components.google import (
CONF_DEVICE_ID)
from homeassistant.const import (
Expand All @@ -26,7 +26,6 @@
REQUIREMENTS = ['todoist-python==7.0.17']

_LOGGER = logging.getLogger(__name__)
DOMAIN = 'todoist'

# Calendar Platform: Does this calendar event last all day?
ALL_DAY = 'all_day'
Expand Down Expand Up @@ -78,7 +77,7 @@
# Todoist API: Fetch all Tasks
TASKS = 'items'

SERVICE_NEW_TASK = 'new_task'
SERVICE_NEW_TASK = 'todoist_new_task'
NEW_TASK_SERVICE_SCHEMA = vol.Schema({
vol.Required(CONTENT): cv.string,
vol.Optional(PROJECT_NAME, default='inbox'): vol.All(cv.string, vol.Lower),
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/media_player/snapcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from homeassistant.components.media_player import (
SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, SUPPORT_SELECT_SOURCE,
PLATFORM_SCHEMA, MediaPlayerDevice)
DOMAIN, PLATFORM_SCHEMA, MediaPlayerDevice)
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_IDLE, STATE_PLAYING, STATE_UNKNOWN, CONF_HOST,
CONF_PORT, ATTR_ENTITY_ID)
Expand All @@ -22,7 +22,7 @@

_LOGGER = logging.getLogger(__name__)

DOMAIN = 'snapcast'
DATA_KEY = 'snapcast'

SERVICE_SNAPSHOT = 'snapcast_snapshot'
SERVICE_RESTORE = 'snapcast_restore'
Expand Down Expand Up @@ -59,7 +59,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
def _handle_service(service):
"""Handle services."""
entity_ids = service.data.get(ATTR_ENTITY_ID)
devices = [device for device in hass.data[DOMAIN]
devices = [device for device in hass.data[DATA_KEY]
if device.entity_id in entity_ids]
for device in devices:
if service.service == SERVICE_SNAPSHOT:
Expand All @@ -84,7 +84,7 @@ def _handle_service(service):
groups = [SnapcastGroupDevice(group) for group in server.groups]
clients = [SnapcastClientDevice(client) for client in server.clients]
devices = groups + clients
hass.data[DOMAIN] = devices
hass.data[DATA_KEY] = devices
async_add_devices(devices)
return True

Expand Down
3 changes: 1 addition & 2 deletions homeassistant/components/media_player/soundtouch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK,
SUPPORT_TURN_OFF, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_STEP,
SUPPORT_VOLUME_SET, SUPPORT_TURN_ON, SUPPORT_PLAY, MediaPlayerDevice,
PLATFORM_SCHEMA)
DOMAIN, PLATFORM_SCHEMA)
from homeassistant.const import (CONF_HOST, CONF_NAME, STATE_OFF, CONF_PORT,
STATE_PAUSED, STATE_PLAYING,
STATE_UNAVAILABLE)
Expand All @@ -23,7 +23,6 @@

_LOGGER = logging.getLogger(__name__)

DOMAIN = 'media_player'
SERVICE_PLAY_EVERYWHERE = 'soundtouch_play_everywhere'
SERVICE_CREATE_ZONE = 'soundtouch_create_zone'
SERVICE_ADD_ZONE_SLAVE = 'soundtouch_add_zone_slave'
Expand Down
5 changes: 2 additions & 3 deletions homeassistant/components/sensor/mopar.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import voluptuous as vol

from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import DOMAIN, PLATFORM_SCHEMA
from homeassistant.helpers.entity import Entity
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, CONF_PIN,
ATTR_ATTRIBUTION, ATTR_COMMAND,
Expand All @@ -23,9 +23,8 @@
_LOGGER = logging.getLogger(__name__)

MIN_TIME_BETWEEN_UPDATES = timedelta(days=7)
DOMAIN = 'mopar'
ATTR_VEHICLE_INDEX = 'vehicle_index'
SERVICE_REMOTE_COMMAND = 'remote_command'
SERVICE_REMOTE_COMMAND = 'mopar_remote_command'
COOKIE_FILE = 'mopar_cookies.pickle'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/switch/broadlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

from homeassistant.util.dt import utcnow
from homeassistant.util import Throttle
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.components.switch import (
SwitchDevice, DOMAIN, PLATFORM_SCHEMA)
from homeassistant.const import (
CONF_FRIENDLY_NAME, CONF_SWITCHES,
CONF_COMMAND_OFF, CONF_COMMAND_ON,
Expand All @@ -28,12 +29,11 @@

TIME_BETWEEN_UPDATES = timedelta(seconds=5)

DOMAIN = 'broadlink'
DEFAULT_NAME = 'Broadlink switch'
DEFAULT_TIMEOUT = 10
DEFAULT_RETRY = 3
SERVICE_LEARN = 'learn_command'
SERVICE_SEND = 'send_packet'
SERVICE_LEARN = 'broadlink_learn_command'
SERVICE_SEND = 'broadlink_send_packet'
CONF_SLOTS = 'slots'

RM_TYPES = ['rm', 'rm2', 'rm_mini', 'rm_pro_phicomm', 'rm2_home_plus',
Expand Down
2 changes: 0 additions & 2 deletions homeassistant/components/switch/scsgate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

CONF_SCS_ID = 'scs_id'

DOMAIN = 'scsgate'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_DEVICES): vol.Schema({cv.slug: scsgate.SCSGATE_SCHEMA}),
})
Expand Down