Skip to content

Commit 397bda2

Browse files
Merge pull request #231 from danielperna84/devel
0.5.2
2 parents 9e36968 + 394545b commit 397bda2

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 0.5.2 (2022-11-08)
2+
- Bugfix: Fix page load with special characters in states (Issue #217)
3+
14
Version 0.5.1 (2022-09-08)
25
- Bugfix: Disable Ace-internal yaml-linting (Issue #226)
36
- Disable internal check for new releases

hass_configurator/configurator.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
SO.setFormatter(
111111
logging.Formatter('%(levelname)s:%(asctime)s:%(name)s:%(message)s'))
112112
LOG.addHandler(SO)
113-
VERSION = "0.5.1"
113+
VERSION = "0.5.2"
114114
BASEDIR = "."
115115
DEV = False
116116
LISTENPORT = None
@@ -826,7 +826,17 @@ def do_GET(self):
826826
req = urllib.request.Request("%sstates" % HASS_API,
827827
headers=headers, method='GET')
828828
with urllib.request.urlopen(req) as response:
829-
states = response.read().decode('utf-8')
829+
states_clean = []
830+
for state in json.loads(response.read().decode('utf-8')):
831+
states_clean.append(
832+
{
833+
"entity_id": state.get("entity_id", ""),
834+
"attributes":
835+
{"friendly_name": state.get("attributes", {}).get(
836+
"friendly_name", state.get("entity_id", ""))}
837+
}
838+
)
839+
states = json.dumps(states_clean)
830840

831841
except Exception as err:
832842
LOG.warning("Exception getting bootstrap")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
NAME = "hass-configurator"
66
PACKAGE_NAME = "hass_configurator"
7-
VERSION = "0.5.1"
7+
VERSION = "0.5.2"
88

99
setup(name=NAME,
1010
version=VERSION,

0 commit comments

Comments
 (0)