Skip to content

Commit a2183e7

Browse files
authored
Decode HTML encoded titles (#58)
1 parent 86110d9 commit a2183e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/youtube/sensor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from homeassistant.helpers.entity import Entity
1515
from dateutil.parser import parse
1616
import re
17+
import html
1718

1819
CONF_CHANNEL_ID = 'channel_id'
1920

@@ -90,7 +91,7 @@ async def async_update(self):
9091
self.published = info.split('<published>')[2].split('</')[0]
9192
thumbnail_url = info.split(
9293
'<media:thumbnail url="')[1].split('"')[0]
93-
self._state = title
94+
self._state = html.unescape(title)
9495
self._image = thumbnail_url
9596
self.stars = info.split('<media:starRating count="')[1].split('"')[0]
9697
self.views = info.split('<media:statistics views="')[1].split('"')[0]

0 commit comments

Comments
 (0)