Skip to content

Add Ukraine Alarm integration#71501

Merged
balloob merged 24 commits intohome-assistant:devfrom
PaulAnnekov:ua_air_raid_siren_component
May 8, 2022
Merged

Add Ukraine Alarm integration#71501
balloob merged 24 commits intohome-assistant:devfrom
PaulAnnekov:ua_air_raid_siren_component

Conversation

@PaulAnnekov
Copy link
Copy Markdown
Contributor

@PaulAnnekov PaulAnnekov commented May 7, 2022

Breaking change

Proposed change

As you know, more than 2 months ago Russian troops started invasion of Ukraine. They bombing our cities with rockets and artillery. I'm introducing a new component that exposes air-raid sirens in Ukraine into HA. Uses Ukraine Alarm API.

In a config flow you can choose a region to watch and will get 4 binary sensors:

  • Air
  • Unknown
  • Artillery
  • Urban Fights

To better understand what happens.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@PaulAnnekov PaulAnnekov requested a review from bdraco May 7, 2022 20:30
bdraco
bdraco previously requested changes May 7, 2022
Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Config flows require 100% test coverage before merging. Please add tests for the config flow.

Thanks 👍

@PaulAnnekov
Copy link
Copy Markdown
Contributor Author

Also, looks like I've disabled tests for my config_flow. Can I do it in a separate PR, so this component can be delivered sooner?

@MartinHjelmare
Copy link
Copy Markdown
Member

Also, looks like I've disabled tests for my config_flow. Can I do it in a separate PR, so this component can be delivered sooner?

Run our scaffold script to get some test template code for the config flow.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 7, 2022

Also, looks like I've disabled tests for my config_flow. Can I do it in a separate PR, so this component can be delivered sooner?

We can't waive the requirement for tests: https://github.com/home-assistant/architecture/blob/master/adr/0010-integration-configuration.md#consequences

python3 -m script.scaffold config_flow can help you get started with them.

balloob and others added 2 commits May 7, 2022 21:53
Co-authored-by: J. Nick Koston <nick@koston.org>
@balloob
Copy link
Copy Markdown
Member

balloob commented May 8, 2022

The code is set up with an optional selector when having to select into district/community. If no selection is made, pick the chosen state/district instead of it's children. The frontend currently does not currently support an optional select: see Home Assistant Design select card.

Let me push a fix.

@balloob
Copy link
Copy Markdown
Member

balloob commented May 8, 2022

@PaulAnnekov can you verify my latest changes still work? The tests pass but I wasn't able to test with an actual API key.

@balloob
Copy link
Copy Markdown
Member

balloob commented May 8, 2022

@PaulAnnekov can you also add an updated screenshot to this PR without the text "hidden"?

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
@PaulAnnekov
Copy link
Copy Markdown
Contributor Author

@PaulAnnekov can you verify my latest changes still work? The tests pass but I wasn't able to test with an actual API key.

Yep, it's working 🎊 .

@PaulAnnekov can you also add an updated screenshot to this PR without the text "hidden"?

Done.

PaulAnnekov and others added 6 commits May 8, 2022 11:15
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 8, 2022

Test failure is not related. I restarted the CI on that test group
ERROR tests/components/stream/test_recorder.py::test_recorder_log[pyloop] - F...

Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@balloob balloob merged commit 2eaaa52 into home-assistant:dev May 8, 2022
@balloob balloob added this to the 2022.5.3 milestone May 8, 2022
balloob added a commit that referenced this pull request May 8, 2022
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
@balloob balloob mentioned this pull request May 8, 2022
@PaulAnnekov
Copy link
Copy Markdown
Contributor Author

Thank you guys for fast review and assistance. You're great 🥳 .

@PaulAnnekov PaulAnnekov deleted the ua_air_raid_siren_component branch May 8, 2022 17:32
@hACKrus

This comment was marked as off-topic.

@home-assistant home-assistant locked as too heated and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants