Home Assistant Unofficial Reference
2024.12.1
entity.py
Go to the documentation of this file.
1
"""Support for the EZcontrol XS1 gateway."""
2
3
import
asyncio
4
5
from
homeassistant.helpers.entity
import
Entity
6
7
# Lock used to limit the amount of concurrent update requests
8
# as the XS1 Gateway can only handle a very
9
# small amount of concurrent requests
10
UPDATE_LOCK = asyncio.Lock()
11
12
13
class
XS1DeviceEntity
(
Entity
):
14
"""Representation of a base XS1 device."""
15
16
def
__init__
(self, device):
17
"""Initialize the XS1 device."""
18
self.
device
device = device
19
20
async
def
async_update
(self):
21
"""Retrieve latest device state."""
22
async
with
UPDATE_LOCK:
23
await self.
hass
hass.async_add_executor_job(self.
device
device.update)
homeassistant.components.xs1.entity.XS1DeviceEntity
Definition:
entity.py:13
homeassistant.components.xs1.entity.XS1DeviceEntity.__init__
def __init__(self, device)
Definition:
entity.py:16
homeassistant.components.xs1.entity.XS1DeviceEntity.async_update
def async_update(self)
Definition:
entity.py:20
homeassistant.components.xs1.entity.XS1DeviceEntity.device
device
Definition:
entity.py:18
homeassistant.helpers.entity.Entity
Definition:
entity.py:433
homeassistant.helpers.entity.Entity.hass
hass
Definition:
entity.py:1357
homeassistant.helpers.entity
Definition:
entity.py:1
core
homeassistant
components
xs1
entity.py
Generated by
1.9.1