Open ReX1983 opened 1 year ago
Yeah, did see this every now and again on mine too... waiting for it to pop back up so I can test, and will look to add a wrapper.
Will probably look to add it in the apidata.py/message method, as sensor.py/extra_state_attributes was designed as more of a controller / gatherer of data than a manipulator. Although if you've already issued a fix locally, happy to review a pull request and merge it in, with full crediting to you.
Honestly, nice to see someone other than me is getting use out of this :)
I'm also experiencing this bug, it causes the lovelace card to disappear from my dashboard, I've worked around it by choosing another local station
Looks like I'm facing this issue too on my side. We've got some pretty hellish weather at the moment here in Scotland, so the alerts will likely be on for a while longer if you want to test with mine :)
Requirements
Current Behavior
Some station messages are reported as:
The Ticket Office is currently closed at XYZ station.
Expected Behavior
and
should not be displayed. ### Steps To Reproduce You just need a station that has ticket office closed message. ### Context _No response_ ### Environment ```markdown - Browser: - HA Version: - NationalRailTimes: ``` ### Anything else? I have modified my local copy of ` def extra_state_attributes(self)` adding the followings before return: ``` pattern1 = re.compile(r'') attributes["message"] = [pattern1.sub('', sub) for sub in attributes["message"]] pattern2 = re.compile(r'') attributes["message"] = [pattern2.sub('', sub) for sub in attributes["message"]] ``` It works, would be good to add something similar in your implementation.