Add model_id to Tuya devices, mark services correctly (#122043)
This commit is contained in:
parent
d0c1632976
commit
1b6f880a27
3 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue