Disable polling for samsungtv remote entities (#93650)

These entities do not have a defined state, there is no reason to poll
This commit is contained in:
J. Nick Koston 2023-05-27 18:55:48 -05:00 committed by GitHub
parent 460d04fc07
commit a56b5994e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,12 +18,14 @@ async def async_setup_entry(
) -> None: ) -> None:
"""Set up the Samsung TV from a config entry.""" """Set up the Samsung TV from a config entry."""
bridge = hass.data[DOMAIN][entry.entry_id] bridge = hass.data[DOMAIN][entry.entry_id]
async_add_entities([SamsungTVRemote(bridge=bridge, config_entry=entry)], True) async_add_entities([SamsungTVRemote(bridge=bridge, config_entry=entry)])
class SamsungTVRemote(SamsungTVEntity, RemoteEntity): class SamsungTVRemote(SamsungTVEntity, RemoteEntity):
"""Device that sends commands to a SamsungTV.""" """Device that sends commands to a SamsungTV."""
_attr_should_poll = False
async def async_turn_off(self, **kwargs: Any) -> None: async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the device off.""" """Turn the device off."""
await self._bridge.async_power_off() await self._bridge.async_power_off()