Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd nilu air_quality platform #19674
Conversation
wafflebot
bot
added
the
in progress
label
Dec 30, 2018
hfurubotten
referenced this pull request
Dec 30, 2018
Merged
Docs for nilu air_quality platform #7993
MartinHjelmare
requested changes
Dec 30, 2018
MartinHjelmare
approved these changes
Jan 2, 2019
Looks good! |
This comment has been minimized.
This comment has been minimized.
Let's wait here until we know if #19448 should be merged first. |
This comment has been minimized.
This comment has been minimized.
#19448 has been merged so we need to rebase and move this platform under the |
hfurubotten
added some commits
Dec 30, 2018
hfurubotten
force-pushed the
hfurubotten:air-pollutants-nilu
branch
from
1223c49
to
1c1a9a7
Jan 6, 2019
hfurubotten
changed the title
Add nilu air_pollutants platform
Add nilu air_quality platform
Jan 6, 2019
This comment has been minimized.
This comment has been minimized.
It should be rebased and moved to the air_quality component now. |
MartinHjelmare
reviewed
Jan 7, 2019
if component_name in self._api.data.sensors: | ||
sensor = self._api.data.sensors[component_name] | ||
return "{0:.2f} {1}".format(sensor.value, | ||
sensor.unit_of_measurement) |
This comment has been minimized.
This comment has been minimized.
MartinHjelmare
Jan 7, 2019
Member
There should preferably not be a unit of measurement but that should be standardized. Maybe we haven't done that yet? @fabaff
This comment has been minimized.
This comment has been minimized.
hfurubotten
Jan 8, 2019
•
Author
Contributor
Is it possible to add a property where it gives the unit of measurement, such as on sensors? I was not sure if all measured components should be defined in µg/m³
, so I added it to the output of each.
All measured pollutants currently supported from the NILU-client is measured in µg/m³
or mg/m³
, so one fit it all is possible with what the air_quality
component gives of information now. CO
/carbon monoxide is the one thats measured in mg/m³
, but this can easily be converted to µg/m³
to get a one fits it all.
Can add this to the platform:
@property
def unit_of_measurement(self) -> str:
"""Return the unit this state is expressed in."""
return 'µg/m³'
This comment has been minimized.
This comment has been minimized.
fabaff
Jan 27, 2019
Member
There should be no unit of measurements because the frontend should take care about this.
This comment has been minimized.
This comment has been minimized.
hfurubotten
Jan 27, 2019
•
Author
Contributor
I will fix the output. What is the default unit the frontend expect, so I can make sure they are correct or converted?
This comment has been minimized.
This comment has been minimized.
Besides the property units this looks good! I'd like @fabaff to comment about that, if there's a plan/spec for that, before we merge. |
hfurubotten commentedDec 30, 2018
•
edited
Description:
New platform in the air_quality platform. Shows data from the governmental air research institute sensor stations within Norway.
Rewritten from a
sensor
platfrom toair_quality
platform. Original PR here: #18104Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7993
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.