From 32570c59c8ac787a5d0c65fb657a3ecf73536ea8 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sun, 6 Oct 2024 22:45:13 +0200 Subject: [PATCH] Bump NYT Games to 0.4.3 (#127717) --- homeassistant/components/nyt_games/coordinator.py | 2 +- homeassistant/components/nyt_games/manifest.json | 2 +- homeassistant/components/nyt_games/sensor.py | 10 ++++++---- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/nyt_games/coordinator.py b/homeassistant/components/nyt_games/coordinator.py index 3b695574750..5e88a5dd92a 100644 --- a/homeassistant/components/nyt_games/coordinator.py +++ b/homeassistant/components/nyt_games/coordinator.py @@ -23,7 +23,7 @@ class NYTGamesData: wordle: Wordle spelling_bee: SpellingBee | None - connections: Connections + connections: Connections | None class NYTGamesCoordinator(DataUpdateCoordinator[NYTGamesData]): diff --git a/homeassistant/components/nyt_games/manifest.json b/homeassistant/components/nyt_games/manifest.json index 1cdc5988e38..a2cd5629ed1 100644 --- a/homeassistant/components/nyt_games/manifest.json +++ b/homeassistant/components/nyt_games/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/nyt_games", "integration_type": "service", "iot_class": "cloud_polling", - "requirements": ["nyt_games==0.4.2"] + "requirements": ["nyt_games==0.4.3"] } diff --git a/homeassistant/components/nyt_games/sensor.py b/homeassistant/components/nyt_games/sensor.py index 6e19a4c21dc..57759fb354d 100644 --- a/homeassistant/components/nyt_games/sensor.py +++ b/homeassistant/components/nyt_games/sensor.py @@ -161,10 +161,11 @@ async def async_setup_entry( NYTGamesSpellingBeeSensor(coordinator, description) for description in SPELLING_BEE_SENSORS ) - entities.extend( - NYTGamesConnectionsSensor(coordinator, description) - for description in CONNECTIONS_SENSORS - ) + if coordinator.data.connections is not None: + entities.extend( + NYTGamesConnectionsSensor(coordinator, description) + for description in CONNECTIONS_SENSORS + ) async_add_entities(entities) @@ -236,4 +237,5 @@ class NYTGamesConnectionsSensor(ConnectionsEntity, SensorEntity): @property def native_value(self) -> StateType | date: """Return the state of the sensor.""" + assert self.coordinator.data.connections is not None return self.entity_description.value_fn(self.coordinator.data.connections) diff --git a/requirements_all.txt b/requirements_all.txt index c1dac727575..af73eb26ffc 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1487,7 +1487,7 @@ numato-gpio==0.13.0 numpy==1.26.4 # homeassistant.components.nyt_games -nyt_games==0.4.2 +nyt_games==0.4.3 # homeassistant.components.oasa_telematics oasatelematics==0.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 20fa385504e..29736911b81 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1235,7 +1235,7 @@ numato-gpio==0.13.0 numpy==1.26.4 # homeassistant.components.nyt_games -nyt_games==0.4.2 +nyt_games==0.4.3 # homeassistant.components.google oauth2client==4.1.3