mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-08-04 01:44:30 +02:00
Reworked scripts to buttons only, fixes #414
This commit is contained in:
parent
ee886e0365
commit
6487398741
5 changed files with 8 additions and 42 deletions
|
@ -12,7 +12,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
|
||||
from homeassistant.const import CONF_VERIFY_SSL
|
||||
|
||||
from .const import PLATFORMS, DOMAIN, RUN_SCRIPT_COMMAND, DEFAULT_VERIFY_SSL
|
||||
from .const import PLATFORMS, DOMAIN, DEFAULT_VERIFY_SSL
|
||||
from .coordinator import MikrotikData, MikrotikCoordinator, MikrotikTrackerCoordinator
|
||||
|
||||
SCRIPT_SCHEMA = vol.Schema(
|
||||
|
@ -40,10 +40,6 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||
|
||||
config_entry.async_on_unload(config_entry.add_update_listener(async_reload_entry))
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, RUN_SCRIPT_COMMAND, coordinator.run_script, schema=SCRIPT_SCHEMA
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
@ -64,7 +60,6 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
|||
if unload_ok := await hass.config_entries.async_unload_platforms(
|
||||
config_entry, PLATFORMS
|
||||
):
|
||||
hass.services.async_remove(DOMAIN, RUN_SCRIPT_COMMAND)
|
||||
hass.data[DOMAIN].pop(config_entry.entry_id)
|
||||
|
||||
return unload_ok
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue