If a client adds air_purity data that isn't in the literal form of "Dangerous Pollution" or something like that with the first letters uppercase and the others lowercase, it will fail to display and raises a runtime error where it's missing a truthy value for a cond statement.
E.g.

This should have a "else" clause that always handles the invalid case but can also handle any kind of upper/lower case scenario as discussed in this Elixir forum post.
Advanced fix to consider:
A better fix would be to make the air_purity levels be an enumerated type across the board, from the HW sensor (Edge), ambi_mock_client and to the Ambi web backend. So instead of using strings like "Dangerous Pollution" it would be a type AirPurity with type values:
NoPollution
LowPollution
MediumPollution
HighPollution
etc...
If a client adds
air_puritydata that isn't in the literal form of "Dangerous Pollution" or something like that with the first letters uppercase and the others lowercase, it will fail to display and raises a runtime error where it's missing a truthy value for acondstatement.E.g.

This should have a "else" clause that always handles the invalid case but can also handle any kind of upper/lower case scenario as discussed in this Elixir forum post.
Advanced fix to consider:
A better fix would be to make the
air_puritylevels be an enumerated type across the board, from the HW sensor (Edge), ambi_mock_client and to the Ambi web backend. So instead of using strings like "Dangerous Pollution" it would be a type AirPurity with type values:NoPollutionLowPollutionMediumPollutionHighPollutionetc...