Refactor Shelly wrapper to coordinator (#79628)

This commit is contained in:
Shay Levy 2022-10-05 15:39:58 +03:00 committed by GitHub
parent 4d3d22320f
commit 22c68b95bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 336 additions and 321 deletions

View file

@ -119,7 +119,7 @@ class BlockSleepingNumber(ShellySleepingBlockAttributeEntity, NumberEntity):
LOGGER.debug("Setting state for entity %s, state: %s", self.name, params)
try:
async with async_timeout.timeout(AIOSHELLY_DEVICE_TIMEOUT_SEC):
return await self.wrapper.device.http_request("get", path, params)
return await self.coordinator.device.http_request("get", path, params)
except (asyncio.TimeoutError, OSError) as err:
LOGGER.error(
"Setting state for entity %s failed, state: %s, error: %s",