jasonsnell / PurpleAir-AQI-Scriptable-Widget

Generate Scriptable app widget to query PurpleAir sensor and display local AQI.
The Unlicense
168 stars 38 forks source link

Replace HTML entities in sensor names #38

Closed bdesham closed 2 years ago

bdesham commented 2 years ago

The data coming from the API has the sensor names encoded using HTML entities (e.g. an ampersand is &) so we need to decode them before showing them.

I know this because I have come across sensors with & encoded this way: for example, sensor 106760, named Polk&Lombard. I assume that < and > are encoded the same way, although some brief poking around the map didn’t turn up any sensors that actually used these characters. (Unsurprisingly 🙂) Apostrophes are not encoded.

Fixes #37.