mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add device action to mobile app to notify (#43814)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Provides device automations for NEW_NAME."""
|
||||
"""Provides device actions for NEW_NAME."""
|
||||
from typing import List, Optional
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -72,8 +72,6 @@ async def async_call_action_from_config(
|
||||
hass: HomeAssistant, config: dict, variables: dict, context: Optional[Context]
|
||||
) -> None:
|
||||
"""Execute a device action."""
|
||||
config = ACTION_SCHEMA(config)
|
||||
|
||||
service_data = {ATTR_ENTITY_ID: config[CONF_ENTITY_ID]}
|
||||
|
||||
if config[CONF_TYPE] == "turn_on":
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""The tests for NEW_NAME device actions."""
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import automation
|
||||
from homeassistant.components.NEW_DOMAIN import DOMAIN
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Provide the device automations for NEW_NAME."""
|
||||
"""Provide the device conditions for NEW_NAME."""
|
||||
from typing import Dict, List
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""The tests for NEW_NAME device conditions."""
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import automation
|
||||
from homeassistant.components.NEW_DOMAIN import DOMAIN
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.const import STATE_OFF, STATE_ON
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Provides device automations for NEW_NAME."""
|
||||
"""Provides device triggers for NEW_NAME."""
|
||||
from typing import List
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -80,11 +80,8 @@ async def async_attach_trigger(
|
||||
automation_info: dict,
|
||||
) -> CALLBACK_TYPE:
|
||||
"""Attach a trigger."""
|
||||
config = TRIGGER_SCHEMA(config)
|
||||
|
||||
# TODO Implement your own logic to attach triggers.
|
||||
# Generally we suggest to re-use the existing state or event
|
||||
# triggers from the automation integration.
|
||||
# Use the existing state or event triggers from the automation integration.
|
||||
|
||||
if config[CONF_TYPE] == "turned_on":
|
||||
from_state = STATE_OFF
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""The tests for NEW_NAME device triggers."""
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import automation
|
||||
from homeassistant.components.NEW_DOMAIN import DOMAIN
|
||||
import homeassistant.components.automation as automation
|
||||
from homeassistant.const import STATE_OFF, STATE_ON
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
Reference in New Issue
Block a user