Clean up 'androidtv.learn_sendevent' service (#37276)

This commit is contained in:
Jeff Irion 2020-06-30 23:48:06 -07:00 committed by GitHub
parent 431045f036
commit f8d11c843d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,10 +118,6 @@ SERVICE_DOWNLOAD_SCHEMA = vol.Schema(
} }
) )
SERVICE_LEARN_SENDEVENT_SCHEMA = vol.Schema(
{vol.Required(ATTR_ENTITY_ID): cv.entity_ids}
)
SERVICE_UPLOAD_SCHEMA = vol.Schema( SERVICE_UPLOAD_SCHEMA = vol.Schema(
{ {
vol.Required(ATTR_ENTITY_ID): cv.entity_ids, vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
@ -280,7 +276,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
) )
platform.async_register_entity_service( platform.async_register_entity_service(
SERVICE_LEARN_SENDEVENT, SERVICE_LEARN_SENDEVENT_SCHEMA, "learn_sendevent", SERVICE_LEARN_SENDEVENT, {}, "learn_sendevent",
) )
def service_download(service): def service_download(service):
@ -592,9 +588,7 @@ class ADBDevice(MediaPlayerEntity):
self.schedule_update_ha_state() self.schedule_update_ha_state()
msg = f"Output from service '{SERVICE_LEARN_SENDEVENT}' from {self.entity_id}: '{output}'" msg = f"Output from service '{SERVICE_LEARN_SENDEVENT}' from {self.entity_id}: '{output}'"
self.hass.components.persistent_notification.async_create( self.hass.components.persistent_notification.create(msg, title="Android TV")
msg, title="Android TV"
)
_LOGGER.info("%s", msg) _LOGGER.info("%s", msg)
@adb_decorator() @adb_decorator()