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 webmin integration #106976

Merged
merged 20 commits into from Feb 26, 2024
Merged

Add webmin integration #106976

merged 20 commits into from Feb 26, 2024

Conversation

autinerd
Copy link
Contributor

@autinerd autinerd commented Jan 3, 2024

Proposed change

This adds the Webmin integration.

Webmin is a Web UI to manage and administrate servers, mostly in the Linux environment.

The data is polled via a XML-RPC API.

My goal is it to have the sensors as much as possible similar to the System Monitor integration.

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:

@autinerd autinerd marked this pull request as ready for review January 3, 2024 19:35
Copy link
Member

@jpbede jpbede left a comment

Choose a reason for hiding this comment

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

First of all thanks for the integration 👍 Here is my first quick review

homeassistant/components/webmin/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/sensor.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/webmin/test_init.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft January 3, 2024 19:55
@home-assistant
Copy link

home-assistant bot commented Jan 3, 2024

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.

@autinerd autinerd marked this pull request as ready for review January 3, 2024 20:39
@home-assistant home-assistant bot requested a review from jpbede January 3, 2024 20:39
@autinerd autinerd marked this pull request as draft January 3, 2024 22:42
@autinerd autinerd marked this pull request as ready for review January 4, 2024 08:51
Copy link
Member

@jpbede jpbede left a comment

Choose a reason for hiding this comment

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

To keep this going :)

homeassistant/components/webmin/config_flow.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/manifest.json Outdated Show resolved Hide resolved
homeassistant/components/webmin/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/sensor.py Show resolved Hide resolved
tests/components/webmin/test_init.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft January 4, 2024 19:16
@autinerd
Copy link
Contributor Author

autinerd commented Jan 5, 2024

One question to the translation strings: Would it be better to first create a PR for the System Monitor integration to switch to strings.json? Then I can reference them here as well, because the sensors will be quite similar.

@jpbede
Copy link
Member

jpbede commented Jan 5, 2024

Hm that would reduce the duplication of strings yes, but the entity names from System Monitor slightly differ from yours. System Monitor appends something to then name:

self._attr_name: str = f"{sensor_description.name} {argument}".rstrip()

@jpbede
Copy link
Member

jpbede commented Jan 5, 2024

Talked about that with an other member, integrations should not reference to other strings from other integrations

@autinerd
Copy link
Contributor Author

autinerd commented Jan 5, 2024

Hm that would reduce the duplication of strings yes, but the entity names from System Monitor slightly differ from yours. System Monitor appends something to then name:

self._attr_name: str = f"{sensor_description.name} {argument}".rstrip()

I will use placeholders as well when I add the disk and network sensors.

Talked about that with an other member, integrations should not reference to other strings from other integrations

Okay, then I will create the strings for my integration.

@autinerd autinerd marked this pull request as ready for review January 5, 2024 13:33
@home-assistant home-assistant bot requested a review from jpbede January 5, 2024 13:33
@home-assistant home-assistant bot requested a review from jpbede January 5, 2024 19:48
Copy link
Member

@jpbede jpbede left a comment

Choose a reason for hiding this comment

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

Two minor things and then I think we're good to go 👍
But I would like a other member also have a look

homeassistant/components/webmin/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/config_flow.py Outdated Show resolved Hide resolved
tests/components/webmin/test_config_flow.py Show resolved Hide resolved
tests/components/webmin/test_init.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft January 5, 2024 20:32
@autinerd autinerd marked this pull request as ready for review January 5, 2024 21:02
@autinerd
Copy link
Contributor Author

autinerd commented Jan 6, 2024

One question I have, should I disable all entites per default like systemmonitor does or should I keep them enabled and the user can disable the ones they don't want?

@jpbede
Copy link
Member

jpbede commented Jan 6, 2024

I guess that would be a good idea as you plan to add more sensors. Depending on the system Webmin is running on, that could be a lot.

@autinerd
Copy link
Contributor Author

autinerd commented Jan 6, 2024

Is done :)

homeassistant/components/webmin/sensor.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/config_flow.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft February 23, 2024 21:18
@autinerd autinerd marked this pull request as ready for review February 24, 2024 08:38
@home-assistant home-assistant bot requested a review from jpbede February 24, 2024 08:38
Copy link
Member

@jpbede jpbede left a comment

Choose a reason for hiding this comment

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

Just two things

homeassistant/components/webmin/coordinator.py Outdated Show resolved Hide resolved
homeassistant/components/webmin/coordinator.py Outdated Show resolved Hide resolved
Copy link
Member

@jpbede jpbede left a comment

Choose a reason for hiding this comment

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

Thanks a lot @autinerd, great job! This looks good to me now 👍

@jpbede jpbede dismissed joostlek’s stale review February 26, 2024 16:09

Comments addressed

@jpbede jpbede merged commit 174ebe7 into home-assistant:dev Feb 26, 2024
53 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 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

3 participants