File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
homeassistant/components/twitch Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 2222ATTR_FOLLOWING = "followers"
2323ATTR_VIEWERS = "viewers"
2424ATTR_STARTED_AT = "started_at"
25+ ATTR_CHANNEL_PICTURE = "channel_picture"
2526
2627STATE_OFFLINE = "offline"
2728STATE_STREAMING = "streaming"
@@ -82,6 +83,7 @@ def extra_state_attributes(self) -> dict[str, Any]:
8283 ATTR_STARTED_AT : channel .started_at ,
8384 ATTR_VIEWERS : channel .viewers ,
8485 ATTR_SUBSCRIPTION : False ,
86+ ATTR_CHANNEL_PICTURE : channel .picture ,
8587 }
8688 if channel .subscribed is not None :
8789 resp [ATTR_SUBSCRIPTION ] = channel .subscribed
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ async def test_offline(
2929 sensor_state = hass .states .get (ENTITY_ID )
3030 assert sensor_state .state == "offline"
3131 assert sensor_state .attributes ["entity_picture" ] == "logo.png"
32+ assert sensor_state .attributes ["channel_picture" ] == "logo.png"
3233
3334
3435async def test_streaming (
@@ -40,6 +41,7 @@ async def test_streaming(
4041 sensor_state = hass .states .get (ENTITY_ID )
4142 assert sensor_state .state == "streaming"
4243 assert sensor_state .attributes ["entity_picture" ] == "stream-medium.png"
44+ assert sensor_state .attributes ["channel_picture" ] == "logo.png"
4345 assert sensor_state .attributes ["game" ] == "Good game"
4446 assert sensor_state .attributes ["title" ] == "Title"
4547 assert sensor_state .attributes ["started_at" ] == datetime (
You can’t perform that action at this time.
0 commit comments