Import homeassistant domain instead of hardcoding it (#17985)
This commit is contained in:
1 parent
87bd2a32e4
commit
4d9ef9e795
5 files changed
+35
-34
No files matched your search
@@ -2,7 +2,7 @@
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import MATCH_ALL, EVENT_TIME_CHANGED
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.core import callback, DOMAIN as HASS_DOMAIN
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.service import async_get_all_descriptions
|
||||
|
||||
@@ -134,7 +134,7 @@ async def handle_call_service(hass, connection, msg):
|
||||
Async friendly.
|
||||
"""
|
||||
blocking = True
|
||||
if (msg['domain'] == 'homeassistant' and
|
||||
if (msg['domain'] == HASS_DOMAIN and
|
||||
msg['service'] in ['restart', 'stop']):
|
||||
blocking = False
|
||||
await hass.services.async_call(
|
||||
|
||||
Reference in new issue
Block a user