Skip to content
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 Sanix integration #106785

Merged
merged 20 commits into from
Apr 17, 2024
Merged

Conversation

tomaszsluszniak
Copy link
Contributor

@tomaszsluszniak tomaszsluszniak commented Dec 31, 2023

Breaking change

Proposed change

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)
  • Deprecation (breaking change to happen in the future)
  • 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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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.

To help with the load of incoming pull requests:

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @tomaszsluszniak

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft December 31, 2023 19:40
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

homeassistant/components/sanix/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/__init__.py Show resolved Hide resolved
homeassistant/components/sanix/binary_sensor.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/sanix.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/sensor.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft January 2, 2024 08:31
@joostlek
Copy link
Member

joostlek commented Jan 3, 2024

You don't really benefit from rebasing your branch at this point btw :)

@tomaszsluszniak
Copy link
Contributor Author

I know, just waiting for my PyPi package to be published :P

@joostlek
Copy link
Member

joostlek commented Jan 3, 2024

Ah nice work!

@tomaszsluszniak tomaszsluszniak marked this pull request as ready for review January 8, 2024 20:48
@home-assistant home-assistant bot requested a review from joostlek January 8, 2024 20:48
homeassistant/components/sanix/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/sanix/sensor.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft January 8, 2024 21:02
@joostlek
Copy link
Member

joostlek commented Jan 9, 2024

Yep, you messed up a bit. I can't directly push to the branch (or I should be able to but I never got it working). I think it's best to start over the PR

@home-assistant home-assistant bot marked this pull request as draft February 17, 2024 19:41
@tomaszsluszniak tomaszsluszniak marked this pull request as ready for review February 17, 2024 20:37
Comment on lines 37 to 39
native_value_fn: Callable[[Measurement], int | datetime | date | str | None] = (
lambda data: None
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
native_value_fn: Callable[[Measurement], int | datetime | date | str | None] = (
lambda data: None
)
native_value_fn: Callable[[Measurement], int | datetime | date | str]

This change was unneeded

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this due to the failing test_load_unload_entry test. Or maybe there is a problem with the test itself. I'm not sure about how it works... or should (I did that based on your test).

)

@property
def native_value(self) -> int | datetime | date | str | None:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def native_value(self) -> int | datetime | date | str | None:
def native_value(self) -> int | datetime | date | str:

@home-assistant home-assistant bot marked this pull request as draft February 17, 2024 20:40

assert entry.state == ConfigEntryState.LOADED

await hass.config_entries.async_remove(entry.entry_id)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
await hass.config_entries.async_remove(entry.entry_id)
await hass.config_entries.async_unload(entry.entry_id)

@joostlek
Copy link
Member

Can you maybe push it with those changes? Maybe I can take a look on why it fails

@tomaszsluszniak
Copy link
Contributor Author

Can you maybe push it with those changes? Maybe I can take a look on why it fails

sure, pushed.

@tomaszsluszniak
Copy link
Contributor Author

tomaszsluszniak commented Apr 17, 2024

Can you maybe push it with those changes? Maybe I can take a look on why it fails

@joostlek did you find some time to look at it?

@joostlek
Copy link
Member

Oh lol, never followed up on it

from .coordinator import SanixCoordinator


@dataclass(frozen=True, kw_only=True)
Copy link
Member

Choose a reason for hiding this comment

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

The reason tests failed was because kw_only=True was missing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was quick ;D thanks a lot

@joostlek joostlek marked this pull request as ready for review April 17, 2024 11:53
@home-assistant home-assistant bot requested a review from joostlek April 17, 2024 11:54
@joostlek
Copy link
Member

I now also changed serial_no to serial_number as I might create a shared CONF_SERIAL_NUMBER

@joostlek
Copy link
Member

I had this notification in my saved notifications and I can remember that I thought at some point like: man, that PR is almost done, when will he follow up on it? (because the state was draft)

@tomaszsluszniak
Copy link
Contributor Author

It seems that I forgot to change the state :/

@joostlek
Copy link
Member

By the way, what is your discord username? (if you have one)

@tomaszsluszniak
Copy link
Contributor Author

tomaszsluszniak

@joostlek joostlek merged commit 864c80f into home-assistant:dev Apr 17, 2024
38 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2024
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.

None yet

2 participants