mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Bump pycoolmasternet-async and add filter and error code support to CoolMastetNet (#84548)
* Add filter and error code support to CoolMastetNet * Create separate entities * Remove async_add_entities_for_platform * Fixed call to async_add_entities * Avoid using test global
This commit is contained in:
29
tests/components/coolmaster/test_button.py
Normal file
29
tests/components/coolmaster/test_button.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""The test for the Coolmaster button platform."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
|
||||
async def test_button(
|
||||
hass: HomeAssistant,
|
||||
load_int: ConfigEntry,
|
||||
) -> None:
|
||||
"""Test the Coolmaster button."""
|
||||
assert hass.states.get("binary_sensor.l1_101_clean_filter").state == "on"
|
||||
|
||||
button = hass.states.get("button.l1_101_reset_filter")
|
||||
assert button is not None
|
||||
await hass.services.async_call(
|
||||
BUTTON_DOMAIN,
|
||||
SERVICE_PRESS,
|
||||
{
|
||||
ATTR_ENTITY_ID: button.entity_id,
|
||||
},
|
||||
blocking=True,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.states.get("binary_sensor.l1_101_clean_filter").state == "off"
|
||||
Reference in New Issue
Block a user