1
mirror of https://github.com/home-assistant/core synced 2024-08-15 18:25:44 +02:00
Go to file
Yuxin Wang 52307708c8
Refactor apcupsd to use config flow (#64809)
* Add Config Flow to APCUPSd integration and remove YAML support.

* Hide the binary sensor if user does not select STATFLAG resource.

* Add tests for config flows.

* Simplify config flow code.

* Spell fix.

* Fix pylint warnings.

* Simplify the code for config flow.

* First attempt to implement import flows to suppport legacy YAML configurations.

* Remove unnecessary log calls.

* Wrap synchronous update call with `hass.async_add_executor_job`.

* Import the YAML configurations when sensor platform is set up.

* Move the logger call since the variables are not properly set up.

* Add codeowner.

* Fix name field of manifest.json.

* Fix linting issue.

* Fix incorrect dependency due to incorrect rebase.

* Update codeowner and config flows via hassfest.

* Postpone the deprecation warning to 2022.7.

* Import future annotations for init file.

* Add an newline at the end to make prettier happy.

* Update github id.

* Add type hints for return types of steps in config flow.

* Move the deprecation date for YAML config to 2022.12.

* Update according to reviews.

* Use async_forward_entry_setups.

* Add helper properties to `APCUPSdData` class.

* Add device_info for binary sensor.

* Simplify config flow.

* Remove options flow strings.

* update the tests according to the changes.

* Add `entity_registry_enabled_default` to entities and use imported CONF_RESOURCES to disable entities instead of skipping them.

* Update according to reviews.

* Do not use model of the UPS as the title for the integration.

Instead, simply use "APCUPSd" as the integration title and let the device info serve as title for each device instead.

* Change schema to be a global variable.

* Add more comments.

* Rewrite the tests for config flows.

* Fix enabled_by_default.

* Show friendly titles in the integration.

* Add import check in `async_setup_platform` to avoid importing in sensor platform setup.

* Add import check in `async_setup_platform` to avoid importing in sensor platform setup.

* Update comments in test files.

* Use parametrize instead of manually iterating different test cases.

* Swap the order of the platform constants.

* Avoid using broad exceptions.

* Set up device info via `_attr_device_info`.

* Remove unrelated test in `test_config_flow`.

* Use `DeviceInfo` instead of dict to assign to `_attr_device_info`.

* Add english translation.

* Add `async_create_issue` for deprecated YAML configuration.

* Enable UPS status by default since it could show "online, charging, on battery etc" which is meaningful for all users.

* Apply suggestions from code review

* Apply suggestion

* Apply suggestion

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-09-28 09:14:04 +02:00
.devcontainer Add GitHub PRs and issues extension to devcontainer (#69296) 2022-04-05 10:17:56 +02:00
.github Bump actions/stale from 5 to 6.0.0 (#78922) 2022-09-22 10:48:34 +02:00
.vscode Add "Home Assistant (skip pip)" to VS Code launch.json (#74887) 2022-07-10 23:06:27 +02:00
docs Update featured integrations image (#76011) 2022-08-02 09:09:24 +02:00
homeassistant Refactor apcupsd to use config flow (#64809) 2022-09-28 09:14:04 +02:00
machine Update Builder & Wheels + support yellow (#73896) 2022-06-23 13:58:24 +02:00
pylint/plugins Adjust pylint plugin for tests directory (#78727) 2022-09-19 14:27:21 +02:00
rootfs Fix logging & exit code reporting to S6 on HA shutdown (#72921) 2022-06-02 19:49:08 +02:00
script Bump cryptography to 38 (#79067) 2022-09-25 17:39:42 -04:00
tests Refactor apcupsd to use config flow (#64809) 2022-09-28 09:14:04 +02:00
.core_files.yaml Add repairs integration to core files (#75489) 2022-07-20 13:02:13 +02:00
.coveragerc Refactor apcupsd to use config flow (#64809) 2022-09-28 09:14:04 +02:00
.dockerignore Integrate dockerbuild (#33168) 2020-03-23 00:39:37 +01:00
.gitattributes highlight Dockerfile.dev as Dockerfile in github ui (#36933) 2020-06-22 14:45:57 +02:00
.gitignore Ignore config directory symlink in development (#56639) 2021-09-25 12:53:41 +02:00
.hadolint.yaml Add hadolint to CI (#34758) 2020-04-27 12:09:31 +02:00
.pre-commit-config.yaml Update pyupgrade to v2.38.0 (#78573) 2022-09-16 12:51:58 +02:00
.prettierignore Add .strict-typing to prettier ignore list (#77177) 2022-08-25 09:39:00 +02:00
.readthedocs.yml Update readthedocs config (#65230) 2022-01-30 20:15:32 -08:00
.strict-typing Enable strict typing for rfxtrx (#74927) 2022-09-23 16:47:58 +02:00
.yamllint Add yamllint (in pre-commit and CI) (#33676) 2020-04-05 10:33:45 +02:00
build.yaml Update Home Assistant base image to 2022.07.0 (#75396) 2022-07-18 15:09:43 +02:00
CLA.md
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md (#73468) 2022-06-23 01:41:22 +02:00
codecov.yml Add little slack to CodeCov project/config-flows threshold (#63379) 2022-01-04 16:26:22 +01:00
CODEOWNERS Refactor apcupsd to use config flow (#64809) 2022-09-28 09:14:04 +02:00
CONTRIBUTING.md Use core GitHub URL in contributing guidelines (#41083) 2020-10-02 20:42:33 +02:00
Dockerfile Add nightly frontend to nightly builds (#74327) 2022-07-02 09:04:35 -07:00
Dockerfile.dev Significantly improve yaml load times when the C loader is available (#73337) 2022-06-13 08:44:46 -10:00
LICENSE.md
MANIFEST.in Move remaining keys to setup.cfg (#65154) 2022-01-28 20:18:09 -08:00
mypy.ini Enable strict typing for rfxtrx (#74927) 2022-09-23 16:47:58 +02:00
pyproject.toml Bump cryptography to 38 (#79067) 2022-09-25 17:39:42 -04:00
README.rst Update featured integrations image (#76011) 2022-08-02 09:09:24 +02:00
requirements_all.txt Bump aiopyarr to 22.9.0 (#79173) 2022-09-28 08:06:24 +02:00
requirements_docs.txt Refactor API documentation (#33217) 2020-03-25 13:21:04 -07:00
requirements_test_all.txt Refactor apcupsd to use config flow (#64809) 2022-09-28 09:14:04 +02:00
requirements_test_pre_commit.txt Update pyupgrade to v2.38.0 (#78573) 2022-09-16 12:51:58 +02:00
requirements_test.txt Update mypy to 0.981 (#79115) 2022-09-26 16:10:06 -04:00
requirements.txt Bump cryptography to 38 (#79067) 2022-09-25 17:39:42 -04:00
setup.cfg Add comment for editable installs (#72782) 2022-05-31 23:04:47 +02:00
tox.ini Update pip version range to 22.3 (#75572) 2022-07-24 21:11:30 +02:00

Home Assistant |Chat Status|
=================================================================================

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation/>`__ and `documentation <https://home-assistant.io/docs/>`__.

|screenshot-states|

Featured integrations
---------------------

|screenshot-integrations|

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/architecture_index/>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/creating_component_index/>`__.

If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.

.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
   :target: https://discord.gg/c5DvZ4e
.. |screenshot-states| image:: https://raw.githubusercontent.com/home-assistant/core/master/docs/screenshots.png
   :target: https://home-assistant.io/demo/
.. |screenshot-integrations| image:: https://raw.githubusercontent.com/home-assistant/core/dev/docs/screenshot-integrations.png
   :target: https://home-assistant.io/integrations/