From fbe35e6e6bd7c48e207abaa122a6ba09fc079a9c Mon Sep 17 00:00:00 2001
From: Joost Lekkerkerker <joostlek@outlook.com>
Date: Fri, 25 Oct 2024 14:19:46 +0200
Subject: [PATCH] Fix NYT Games connection max streak (#129149)

---
 homeassistant/components/nyt_games/sensor.py          | 2 +-
 tests/components/nyt_games/snapshots/test_sensor.ambr | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/homeassistant/components/nyt_games/sensor.py b/homeassistant/components/nyt_games/sensor.py
index 57759fb354d..01b2db4620b 100644
--- a/homeassistant/components/nyt_games/sensor.py
+++ b/homeassistant/components/nyt_games/sensor.py
@@ -139,7 +139,7 @@ CONNECTIONS_SENSORS: tuple[NYTGamesConnectionsSensorEntityDescription, ...] = (
         state_class=SensorStateClass.TOTAL_INCREASING,
         native_unit_of_measurement=UnitOfTime.DAYS,
         device_class=SensorDeviceClass.DURATION,
-        value_fn=lambda connections: connections.current_streak,
+        value_fn=lambda connections: connections.max_streak,
     ),
 )
 
diff --git a/tests/components/nyt_games/snapshots/test_sensor.ambr b/tests/components/nyt_games/snapshots/test_sensor.ambr
index fdec7d58d9d..84b74a26f0d 100644
--- a/tests/components/nyt_games/snapshots/test_sensor.ambr
+++ b/tests/components/nyt_games/snapshots/test_sensor.ambr
@@ -98,7 +98,7 @@
     'last_changed': <ANY>,
     'last_reported': <ANY>,
     'last_updated': <ANY>,
-    'state': '0',
+    'state': '2',
   })
 # ---
 # name: test_all_entities[sensor.connections_last_played-entry]
-- 
GitLab