New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GIOS integration #28719
Add GIOS integration #28719
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A very brief review.
@property | ||
def icon(self): | ||
"""Return the icon.""" | ||
if self._aqi == "bardzo dobry": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be defined as constants (better even if defined in the backend library) in english.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GIOS server sends AQI states in Polish. Do you think I need to translate those to English in backend library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no other identifier besides the (translated) string? Imo it would make sense to have those as constants as it is just cleaner that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AQI state strings from server are only in Polish. I added consts with English names for that states. I think that it's now understandable for non-Polish people.
return self._aqi | ||
|
||
@property | ||
@round_state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rounding be left to the consumers of the data? I don't personally mind, but I think someone might :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rytilahti In Poland, most air quality services on the Internet rounding off values. I think this is a good approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
||
if user_input is not None: | ||
try: | ||
already_configured = self._async_current_ids() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set unique ID first and then you can use self._abort_if_unique_id_configured() here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Breaking Change:
None
Description:
New integration that shows air quality data in Poland from GIOŚ (Polish Chief Inspectorate Of Environmental Protection) service http://powietrze.gios.gov.pl/pjp/current
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#11162
Example entry for
configuration.yaml
(if applicable):Integration uses only
config_flow
configuration.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:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: