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:
cdce8p authored and Paulus Schoutsen committed 2018-09-26 08:50:05 +02:00
1 parent 672fc61bb2
commit e2a56721d3
22 files changed
+217 -231

No files matched your search

+39 -2
View File
@@ -4,13 +4,50 @@ import asyncio
import unittest
from homeassistant.core import CoreState, State, Context
from homeassistant.setup import setup_component, async_setup_component
from homeassistant.components.input_number import (
DOMAIN, set_value, increment, decrement)
ATTR_VALUE, DOMAIN, SERVICE_DECREMENT, SERVICE_INCREMENT,
SERVICE_SET_VALUE)
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.loader import bind_hass
from homeassistant.setup import setup_component, async_setup_component
from tests.common import get_test_home_assistant, mock_restore_cache
@bind_hass
def set_value(hass, entity_id, value):
"""Set input_number to value.
This is a legacy helper method. Do not use it for new tests.
"""
hass.services.call(DOMAIN, SERVICE_SET_VALUE, {
ATTR_ENTITY_ID: entity_id,
ATTR_VALUE: value,
})
@bind_hass
def increment(hass, entity_id):
"""Increment value of entity.
This is a legacy helper method. Do not use it for new tests.
"""
hass.services.call(DOMAIN, SERVICE_INCREMENT, {
ATTR_ENTITY_ID: entity_id
})
@bind_hass
def decrement(hass, entity_id):
"""Decrement value of entity.
This is a legacy helper method. Do not use it for new tests.
"""
hass.services.call(DOMAIN, SERVICE_DECREMENT, {
ATTR_ENTITY_ID: entity_id
})
class TestInputNumber(unittest.TestCase):
"""Test the input number component."""