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 
14  """Representation of a base XS1 device."""
15 
16  def __init__(self, device):
17  """Initialize the XS1 device."""
18  self.devicedevice = device
19 
20  async def async_update(self):
21  """Retrieve latest device state."""
22  async with UPDATE_LOCK:
23  await self.hasshass.async_add_executor_job(self.devicedevice.update)