mirror of
https://github.com/home-assistant/core.git
synced 2026-02-25 12:27:07 +00:00
Update kitchen_sink
This commit is contained in:
@@ -4,8 +4,10 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import infrared_protocols
|
||||
|
||||
from homeassistant.components.fan import FanEntity, FanEntityFeature
|
||||
from homeassistant.components.infrared import NECInfraredCommand, async_send_command
|
||||
from homeassistant.components.infrared import async_send_command
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import STATE_UNAVAILABLE
|
||||
from homeassistant.core import Event, EventStateChangedData, HomeAssistant, callback
|
||||
@@ -102,7 +104,7 @@ class DemoInfraredFan(FanEntity):
|
||||
|
||||
async def _send_command(self, command_code: int) -> None:
|
||||
"""Send an IR command using the NEC protocol."""
|
||||
command = NECInfraredCommand(
|
||||
command = infrared_protocols.NECCommand(
|
||||
address=DUMMY_FAN_ADDRESS,
|
||||
command=command_code,
|
||||
modulation=38000,
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import infrared_protocols
|
||||
|
||||
from homeassistant.components import persistent_notification
|
||||
from homeassistant.components.infrared import InfraredCommand, InfraredEntity
|
||||
from homeassistant.components.infrared import InfraredEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
@@ -51,7 +53,7 @@ class DemoInfrared(InfraredEntity):
|
||||
)
|
||||
self._attr_name = entity_name
|
||||
|
||||
async def async_send_command(self, command: InfraredCommand) -> None:
|
||||
async def async_send_command(self, command: infrared_protocols.Command) -> None:
|
||||
"""Send an IR command."""
|
||||
timings = [
|
||||
interval
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
"name": "Everything but the Kitchen Sink",
|
||||
"after_dependencies": ["recorder"],
|
||||
"codeowners": ["@home-assistant/core"],
|
||||
"dependencies": ["infrared"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/kitchen_sink",
|
||||
"iot_class": "calculated",
|
||||
"preview_features": {
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
from unittest.mock import patch
|
||||
|
||||
from freezegun.api import FrozenDateTimeFactory
|
||||
import infrared_protocols
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.infrared import NECInfraredCommand, async_send_command
|
||||
from homeassistant.components.infrared import async_send_command
|
||||
from homeassistant.components.kitchen_sink import DOMAIN
|
||||
from homeassistant.const import STATE_UNKNOWN, Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
@@ -44,7 +45,9 @@ async def test_send_command(
|
||||
assert now is not None
|
||||
freezer.move_to(now)
|
||||
|
||||
command = NECInfraredCommand(address=0x04, command=0x08, modulation=38000)
|
||||
command = infrared_protocols.NECCommand(
|
||||
address=0x04, command=0x08, modulation=38000
|
||||
)
|
||||
await async_send_command(hass, ENTITY_IR_TRANSMITTER, command)
|
||||
|
||||
state = hass.states.get(ENTITY_IR_TRANSMITTER)
|
||||
|
||||
Reference in New Issue
Block a user