Unverified Commit e49b9196 authored by dotlambda's avatar dotlambda Committed by GitHub
Browse files

home-assistant-custom-components.local_luftdaten: drop async-timeout dependency (#456009)

parents 6ccfebec 7d0a2711
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
From 06a6b3ff1ae181f9972b47838569d658ba4b3d9c Mon Sep 17 00:00:00 2001
From: Martin Weinelt <hexa@darmstadt.ccc.de>
Date: Sat, 4 Oct 2025 14:45:02 +0200
Subject: [PATCH] Use the python native asyncio timeout function

instead of depending on the undeclared async-timeout package.
---
 custom_components/local_luftdaten/sensor.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/custom_components/local_luftdaten/sensor.py b/custom_components/local_luftdaten/sensor.py
index 4f4f5b4..82ea041 100644
--- a/custom_components/local_luftdaten/sensor.py
+++ b/custom_components/local_luftdaten/sensor.py
@@ -12,7 +12,6 @@
 import asyncio
 from typing import Optional
 import aiohttp
-import async_timeout
 import datetime
 
 import json
@@ -170,7 +169,7 @@ async def async_update(self):
             responseData = None
             try:
                 _LOGGER.debug("Get data from %s", str(self._resource))
-                with async_timeout.timeout(30):
+                async with asyncio.timeout(30):
                     response = await self._session.get(self._resource)
                 responseData = await response.text()
                 _LOGGER.debug("Received data: %s", str(self.data))
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@ buildHomeAssistantComponent rec {
    hash = "sha256-68clZgS7Qo62srcZWD3Un9BnNSwQUBr4Z5oBMTC9m8o=";
  };

  # https://github.com/lichtteil/local_luftdaten/pull/70
  # Replace undeclared async-timeout dependency with native asyncio.timeout
  patches = [ ./async-timeout.patch ];

  meta = with lib; {
    changelog = "https://github.com/lichtteil/local_luftdaten/releases/tag/${version}";
    description = "Custom component for Home Assistant that integrates your (own) local Luftdaten sensor (air quality/particle sensor) without using the cloud";