Add model_id to Tuya devices, mark services correctly (#122043)

This commit is contained in:
Franck Nijhof 2024-07-17 00:09:18 +02:00 committed by GitHub
parent d0c1632976
commit 1b6f880a27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View file

@ -89,6 +89,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: TuyaConfigEntry) -> bool
manufacturer="Tuya",
name=device.name,
model=f"{device.product_name} (unsupported)",
model_id=device.product_id,
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

View file

@ -151,7 +151,8 @@ class TuyaEntity(Entity):
identifiers={(DOMAIN, self.device.id)},
manufacturer="Tuya",
name=self.device.name,
model=f"{self.device.product_name} ({self.device.product_id})",
model=self.device.product_name,
model_id=self.device.product_id,
)
@property

View file

@ -8,7 +8,7 @@ from tuya_sharing import Manager, SharingScene
from homeassistant.components.scene import Scene
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import TuyaConfigEntry
@ -46,6 +46,7 @@ class TuyaSceneEntity(Scene):
manufacturer="tuya",
name=self.scene.name,
model="Tuya Scene",
entry_type=DeviceEntryType.SERVICE,
)
@property