Browse Source

maint: Updates for HA 2026.6

- InfraredEntity, introduced 2 months ago is deprecated already,
  renamed to InfraredEmitterEntity.
- NECCommand has moved within infrared-protocols library.
- Bump pytest-homeassistant-custom_component and HA requirements
- Bump version
Jason Rumney 4 tuần trước cách đây
mục cha
commit
a308544eed

+ 2 - 2
custom_components/tuya_local/infrared.py

@@ -7,7 +7,7 @@ import json
 import logging
 from typing import override
 
-from homeassistant.components.infrared import InfraredCommand, InfraredEntity
+from homeassistant.components.infrared import InfraredCommand, InfraredEmitterEntity
 from tinytuya.Contrib.IRRemoteControlDevice import IRRemoteControlDevice as IR
 
 from .device import TuyaLocalDevice
@@ -30,7 +30,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
     )
 
 
-class TuyaLocalInfrared(TuyaLocalEntity, InfraredEntity):
+class TuyaLocalInfrared(TuyaLocalEntity, InfraredEmitterEntity):
     """Representation of a Tuya Local infrared control device."""
 
     def __init__(self, device: TuyaLocalDevice, config: TuyaEntityConfig):

+ 1 - 1
custom_components/tuya_local/manifest.json

@@ -18,5 +18,5 @@
         "tinytuya==1.18.1",
         "tuya-device-sharing-sdk~=0.2.4"
     ],
-    "version": "2026.6.1"
+    "version": "2026.6.2"
 }

+ 1 - 1
hacs.json

@@ -1,5 +1,5 @@
 {
     "name": "Tuya Local",
-    "homeassistant": "2026.5.0",
+    "homeassistant": "2026.6.0",
     "hacs": "2.0.0"
 }

+ 2 - 2
pyproject.toml

@@ -28,10 +28,10 @@ entities = "util.entities:main"
 [dependency-groups]
 dev = [
   "fuzzywuzzy",
-  "infrared-protocols~=2.0",
+  "infrared-protocols>=5.6",
   "levenshtein",
   "PyTurboJPEG~=1.8.0",
-  "pytest-homeassistant-custom-component==0.13.333",
+  "pytest-homeassistant-custom-component==0.13.336",
   "pytest",
   "pytest-asyncio",
   "pytest-cov",

+ 1 - 1
tests/test_infrared.py

@@ -1,7 +1,7 @@
 """Tests for the infrared entity."""
 
 import pytest
-from infrared_protocols.commands import NECCommand
+from infrared_protocols.commands.nec import NECCommand
 from pytest_homeassistant_custom_component.common import MockConfigEntry
 
 from custom_components.tuya_local.const import (