mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Remove service helper (3) (#16879)
* Update duckdns * Update google_assistant * Update group * Update homematic * Update image_processing * Update input_boolean * Update input_number * Update input_select * Update input_text
This commit is contained in:
16
tests/components/group/common.py
Normal file
16
tests/components/group/common.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""Collection of helper methods.
|
||||
|
||||
All containing methods are legacy helpers that should not be used by new
|
||||
components. Instead call the service directly.
|
||||
"""
|
||||
from homeassistant.components.group import ATTR_VISIBLE, DOMAIN, \
|
||||
SERVICE_SET_VISIBILITY
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from homeassistant.loader import bind_hass
|
||||
|
||||
|
||||
@bind_hass
|
||||
def set_visibility(hass, entity_id=None, visible=True):
|
||||
"""Hide or shows a group."""
|
||||
data = {ATTR_ENTITY_ID: entity_id, ATTR_VISIBLE: visible}
|
||||
hass.services.call(DOMAIN, SERVICE_SET_VISIBILITY, data)
|
||||
Reference in New Issue
Block a user