From a15a010117b5bafe2d4bf3fe69fc8b8f62223c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20Schr=C3=B6ter?= <487046+jschroeter@users.noreply.github.com> Date: Sun, 1 Oct 2023 13:33:27 +0000 Subject: [PATCH] initial setup --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/workflows/release.yml | 8 +- LICENSE | 2 +- README.md | 102 ++++++++++-------- README_EXAMPLE.md | 59 ---------- README_dev.md | 47 ++++++++ config/configuration.yaml | 2 +- .../integration_blueprint/__init__.py | 4 +- .../integration_blueprint/binary_sensor.py | 8 +- .../integration_blueprint/const.py | 6 +- .../integration_blueprint/coordinator.py | 2 +- .../integration_blueprint/manifest.json | 10 +- .../integration_blueprint/sensor.py | 6 +- .../integration_blueprint/switch.py | 6 +- .../translations/en.json | 2 +- hacs.json | 6 +- requirements.txt | 4 +- scripts/develop | 2 +- 19 files changed, 137 insertions(+), 143 deletions(-) delete mode 100644 README_EXAMPLE.md create mode 100644 README_dev.md diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 9c65fef..57cbe5a 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -22,7 +22,7 @@ body: required: true - label: This issue only contains 1 issue (if you have multiple issues, open one issue for each issue). required: true - - label: This issue is not a duplicate issue of currently [previous issues](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Bug%22+).. + - label: This issue is not a duplicate issue of currently [previous issues](https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor/issues?q=is%3Aissue+label%3A%22Bug%22+).. required: true - type: textarea attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 433467b..aed65b1 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -14,7 +14,7 @@ body: required: true - label: This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request). required: true - - label: This issue is not a duplicate feature request of [previous feature requests](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Feature+Request%22+). + - label: This issue is not a duplicate feature request of [previous feature requests](https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor/issues?q=is%3Aissue+label%3A%22Feature+Request%22+). required: true - type: textarea diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2ac43a..28240f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,15 +21,15 @@ jobs: shell: "bash" run: | yq -i -o json '.version="${{ github.event.release.tag_name }}"' \ - "${{ github.workspace }}/custom_components/integration_blueprint/manifest.json" + "${{ github.workspace }}/custom_components/limodor_airodor/manifest.json" - name: "ZIP the integration directory" shell: "bash" run: | - cd "${{ github.workspace }}/custom_components/integration_blueprint" - zip integration_blueprint.zip -r ./ + cd "${{ github.workspace }}/custom_components/limodor_airodor" + zip limodor_airodor.zip -r ./ - name: "Upload the ZIP file to the release" uses: softprops/action-gh-release@v0.1.15 with: - files: ${{ github.workspace }}/custom_components/integration_blueprint/integration_blueprint.zip + files: ${{ github.workspace }}/custom_components/limodor_airodor.zip diff --git a/LICENSE b/LICENSE index e56d915..ca4d188 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 - 2023 Joakim Sørensen @ludeeus +Copyright (c) 2019 - 2023 Jakob Schröter @jschroeter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e15e9ef..dd0e3e2 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,55 @@ -# Notice - -The component and platforms in this repository are not meant to be used by a -user, but as a "blueprint" that custom component developers can build -upon, to make more awesome stuff. - -HAVE FUN! 😎 - -## Why? - -This is simple, by having custom_components look (README + structure) the same -it is easier for developers to help each other and for users to start using them. - -If you are a developer and you want to add things to this "blueprint" that you think more -developers will have use for, please open a PR to add it :) - -## What? - -This repository contains multiple files, here is a overview: - -File | Purpose | Documentation --- | -- | -- -`.devcontainer.json` | Used for development/testing with Visual Studio Code. | [Documentation](https://code.visualstudio.com/docs/remote/containers) -`.github/ISSUE_TEMPLATE/*.yml` | Templates for the issue tracker | [Documentation](https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository) -`.vscode/tasks.json` | Tasks for the devcontainer. | [Documentation](https://code.visualstudio.com/docs/editor/tasks) -`custom_components/integration_blueprint/*` | Integration files, this is where everything happens. | [Documentation](https://developers.home-assistant.io/docs/creating_component_index) -`CONTRIBUTING.md` | Guidelines on how to contribute. | [Documentation](https://help.github.com/en/github/building-a-strong-community/setting-guidelines-for-repository-contributors) -`LICENSE` | The license file for the project. | [Documentation](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository) -`README.md` | The file you are reading now, should contain info about the integration, installation and configuration instructions. | [Documentation](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax) -`requirements.txt` | Python packages used for development/lint/testing this integration. | [Documentation](https://pip.pypa.io/en/stable/user_guide/#requirements-files) - -## How? - -1. Create a new repository in GitHub, using this repository as a template by clicking the "Use this template" button in the GitHub UI. -1. Open your new repository in Visual Studio Code devcontainer (Preferably with the "`Dev Containers: Clone Repository in Named Container Volume...`" option). -1. Rename all instances of the `integration_blueprint` to `custom_components/` (e.g. `custom_components/awesome_integration`). -1. Rename all instances of the `Integration Blueprint` to `` (e.g. `Awesome Integration`). -1. Run the `scripts/develop` to start HA and test out your new integration. - -## Next steps - -These are some next steps you may want to look into: -- Add tests to your integration, [`pytest-homeassistant-custom-component`](https://github.com/MatthewFlamm/pytest-homeassistant-custom-component) can help you get started. -- Add brand images (logo/icon) to https://github.com/home-assistant/brands. -- Create your first release. -- Share your integration on the [Home Assistant Forum](https://community.home-assistant.io/). -- Submit your integration to the [HACS](https://hacs.xyz/docs/publish/start). +# LIMODOR AirOdor AD-UV HomeAssistant integration + +[![GitHub Release][releases-shield]][releases] +[![GitHub Activity][commits-shield]][commits] +[![License][license-shield]](LICENSE) + +![Project Maintenance][maintenance-shield] +[![BuyMeCoffee][buymecoffeebadge]][buymecoffee] + +[![Discord][discord-shield]][discord] +[![Community Forum][forum-shield]][forum] +[![Open this repository in HACS][hacsbadge]][hacs_my] + +_Integration to integrate with [custom_components/limodor_airodor][custom_components/limodor_airodor]._ + +**This integration will set up the following platforms.** + +Platform | Description +-- | -- +`binary_sensor` | Show something `True` or `False`. +`sensor` | Show info from blueprint API. +`switch` | Switch something `True` or `False`. + +## Installation + +1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`). +1. If you do not have a `custom_components` directory (folder) there, you need to create it. +1. In the `custom_components` directory (folder) create a new folder called `custom_components/limodor_airodor`. +1. Download _all_ the files from the `custom_components/custom_components/limodor_airodor/` directory (folder) in this repository. +1. Place the files you downloaded in the new directory (folder) you created. +1. Restart Home Assistant +1. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "LIMODOR AirOdor" + +## Configuration is done in the UI + + + +## Contributions are welcome! + +If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md) + +*** + +[limodor_airodor]: https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor +[commits-shield]: https://img.shields.io/github/commit-activity/y/jschroeter/HomeAssistant-Limodor-AirOdor.svg?style=for-the-badge +[commits]: https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor/commits/main +[hacs_my]: https://my.home-assistant.io/redirect/hacs_repository/?owner=jschroeter&repository=HomeAssistant-Limodor-AirOdor&category=integration +[hacsbadge]: https://my.home-assistant.io/badges/hacs_repository.svg +[exampleimg]: example.png +[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge +[forum]: https://community.home-assistant.io/ +[license-shield]: https://img.shields.io/github/license/jschroeter/HomeAssistant-Limodor-AirOdor.svg?style=for-the-badge +[maintenance-shield]: https://img.shields.io/badge/maintainer-Jakob%20Schr%C3%B6ter%20%40jschroeter-blue.svg?style=for-the-badge +[releases-shield]: https://img.shields.io/github/release/jschroeter/HomeAssistant-Limodor-AirOdor.svg?style=for-the-badge +[releases]: https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor/releases diff --git a/README_EXAMPLE.md b/README_EXAMPLE.md deleted file mode 100644 index acaf6ae..0000000 --- a/README_EXAMPLE.md +++ /dev/null @@ -1,59 +0,0 @@ -# Integration Blueprint - -[![GitHub Release][releases-shield]][releases] -[![GitHub Activity][commits-shield]][commits] -[![License][license-shield]](LICENSE) - -![Project Maintenance][maintenance-shield] -[![BuyMeCoffee][buymecoffeebadge]][buymecoffee] - -[![Discord][discord-shield]][discord] -[![Community Forum][forum-shield]][forum] -[![Open this repository in HACS][hacsbadge]][hacs_my] - -_Integration to integrate with [integration_blueprint][integration_blueprint]._ - -**This integration will set up the following platforms.** - -Platform | Description --- | -- -`binary_sensor` | Show something `True` or `False`. -`sensor` | Show info from blueprint API. -`switch` | Switch something `True` or `False`. - -## Installation - -1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`). -1. If you do not have a `custom_components` directory (folder) there, you need to create it. -1. In the `custom_components` directory (folder) create a new folder called `integration_blueprint`. -1. Download _all_ the files from the `custom_components/integration_blueprint/` directory (folder) in this repository. -1. Place the files you downloaded in the new directory (folder) you created. -1. Restart Home Assistant -1. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Integration blueprint" - -## Configuration is done in the UI - - - -## Contributions are welcome! - -If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md) - -*** - -[integration_blueprint]: https://github.com/ludeeus/integration_blueprint -[buymecoffee]: https://www.buymeacoffee.com/ludeeus -[buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge -[commits-shield]: https://img.shields.io/github/commit-activity/y/ludeeus/integration_blueprint.svg?style=for-the-badge -[commits]: https://github.com/ludeeus/integration_blueprint/commits/main -[hacs_my]: https://my.home-assistant.io/redirect/hacs_repository/?owner=ludeeus&repository=integration_blueprint&category=integration -[hacsbadge]: https://my.home-assistant.io/badges/hacs_repository.svg -[discord]: https://discord.gg/Qa5fW2R -[discord-shield]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge -[exampleimg]: example.png -[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge -[forum]: https://community.home-assistant.io/ -[license-shield]: https://img.shields.io/github/license/ludeeus/integration_blueprint.svg?style=for-the-badge -[maintenance-shield]: https://img.shields.io/badge/maintainer-Joakim%20Sørensen%20%40ludeeus-blue.svg?style=for-the-badge -[releases-shield]: https://img.shields.io/github/release/ludeeus/integration_blueprint.svg?style=for-the-badge -[releases]: https://github.com/ludeeus/integration_blueprint/releases diff --git a/README_dev.md b/README_dev.md new file mode 100644 index 0000000..7ba49c7 --- /dev/null +++ b/README_dev.md @@ -0,0 +1,47 @@ +# Notice + +The component and platforms in this repository are not meant to be used by a +user, but as a "blueprint" that custom component developers can build +upon, to make more awesome stuff. + +HAVE FUN! 😎 + +## Why? + +This is simple, by having custom_components look (README + structure) the same +it is easier for developers to help each other and for users to start using them. + +If you are a developer and you want to add things to this "blueprint" that you think more +developers will have use for, please open a PR to add it :) + +## What? + +This repository contains multiple files, here is a overview: + +File | Purpose | Documentation +-- | -- | -- +`.devcontainer.json` | Used for development/testing with Visual Studio Code. | [Documentation](https://code.visualstudio.com/docs/remote/containers) +`.github/ISSUE_TEMPLATE/*.yml` | Templates for the issue tracker | [Documentation](https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository) +`.vscode/tasks.json` | Tasks for the devcontainer. | [Documentation](https://code.visualstudio.com/docs/editor/tasks) +`custom_components/custom_components/limodor-airodor/*` | Integration files, this is where everything happens. | [Documentation](https://developers.home-assistant.io/docs/creating_component_index) +`CONTRIBUTING.md` | Guidelines on how to contribute. | [Documentation](https://help.github.com/en/github/building-a-strong-community/setting-guidelines-for-repository-contributors) +`LICENSE` | The license file for the project. | [Documentation](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository) +`README.md` | The file you are reading now, should contain info about the integration, installation and configuration instructions. | [Documentation](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax) +`requirements.txt` | Python packages used for development/lint/testing this integration. | [Documentation](https://pip.pypa.io/en/stable/user_guide/#requirements-files) + +## How? + +1. Create a new repository in GitHub, using this repository as a template by clicking the "Use this template" button in the GitHub UI. +1. Open your new repository in Visual Studio Code devcontainer (Preferably with the "`Dev Containers: Clone Repository in Named Container Volume...`" option). +1. Rename all instances of the `custom_components/limodor-airodor` to `custom_components/` (e.g. `custom_components/awesome_integration`). +1. Rename all instances of the `LIMODOR AirOdor` to `` (e.g. `Awesome Integration`). +1. Run the `scripts/develop` to start HA and test out your new integration. + +## Next steps + +These are some next steps you may want to look into: +- Add tests to your integration, [`pytest-homeassistant-custom-component`](https://github.com/MatthewFlamm/pytest-homeassistant-custom-component) can help you get started. +- Add brand images (logo/icon) to https://github.com/home-assistant/brands. +- Create your first release. +- Share your integration on the [Home Assistant Forum](https://community.home-assistant.io/). +- Submit your integration to the [HACS](https://hacs.xyz/docs/publish/start). diff --git a/config/configuration.yaml b/config/configuration.yaml index 8c0d4e4..d2964cd 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -5,4 +5,4 @@ default_config: logger: default: info logs: - custom_components.integration_blueprint: debug + custom_components.limodor_airodor: debug diff --git a/custom_components/integration_blueprint/__init__.py b/custom_components/integration_blueprint/__init__.py index a9adfdc..328ffde 100644 --- a/custom_components/integration_blueprint/__init__.py +++ b/custom_components/integration_blueprint/__init__.py @@ -1,7 +1,7 @@ -"""Custom integration to integrate integration_blueprint with Home Assistant. +"""Custom integration to integrate LIMODOR AirOdor with Home Assistant. For more details about this integration, please refer to -https://github.com/ludeeus/integration_blueprint +https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor """ from __future__ import annotations diff --git a/custom_components/integration_blueprint/binary_sensor.py b/custom_components/integration_blueprint/binary_sensor.py index fff5b21..4a7ca80 100644 --- a/custom_components/integration_blueprint/binary_sensor.py +++ b/custom_components/integration_blueprint/binary_sensor.py @@ -1,4 +1,4 @@ -"""Binary sensor platform for integration_blueprint.""" +"""Binary sensor platform for limodor_airodor.""" from __future__ import annotations from homeassistant.components.binary_sensor import ( @@ -13,8 +13,8 @@ ENTITY_DESCRIPTIONS = ( BinarySensorEntityDescription( - key="integration_blueprint", - name="Integration Blueprint Binary Sensor", + key="limodor_airodor", + name="LIMODOR AirOdor Binary Sensor", device_class=BinarySensorDeviceClass.CONNECTIVITY, ), ) @@ -33,7 +33,7 @@ async def async_setup_entry(hass, entry, async_add_devices): class IntegrationBlueprintBinarySensor(IntegrationBlueprintEntity, BinarySensorEntity): - """integration_blueprint binary_sensor class.""" + """limodor_airodor binary_sensor class.""" def __init__( self, diff --git a/custom_components/integration_blueprint/const.py b/custom_components/integration_blueprint/const.py index 66c28f3..bf989de 100644 --- a/custom_components/integration_blueprint/const.py +++ b/custom_components/integration_blueprint/const.py @@ -1,9 +1,9 @@ -"""Constants for integration_blueprint.""" +"""Constants for limodor_airodor.""" from logging import Logger, getLogger LOGGER: Logger = getLogger(__package__) -NAME = "Integration blueprint" -DOMAIN = "integration_blueprint" +NAME = "LIMODOR AirOdor" +DOMAIN = "limodor_airodor" VERSION = "0.0.0" ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/" diff --git a/custom_components/integration_blueprint/coordinator.py b/custom_components/integration_blueprint/coordinator.py index d427a1a..6d3239e 100644 --- a/custom_components/integration_blueprint/coordinator.py +++ b/custom_components/integration_blueprint/coordinator.py @@ -1,4 +1,4 @@ -"""DataUpdateCoordinator for integration_blueprint.""" +"""DataUpdateCoordinator for limodor_airodor.""" from __future__ import annotations from datetime import timedelta diff --git a/custom_components/integration_blueprint/manifest.json b/custom_components/integration_blueprint/manifest.json index 817cd7b..3e64a54 100644 --- a/custom_components/integration_blueprint/manifest.json +++ b/custom_components/integration_blueprint/manifest.json @@ -1,12 +1,12 @@ { - "domain": "integration_blueprint", - "name": "Integration blueprint", + "domain": "limodor_airodor", + "name": "LIMODOR AirOdor AD-UV integration", "codeowners": [ - "@ludeeus" + "@jschroeter" ], "config_flow": true, - "documentation": "https://github.com/ludeeus/integration_blueprint", + "documentation": "https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor", "iot_class": "cloud_polling", - "issue_tracker": "https://github.com/ludeeus/integration_blueprint/issues", + "issue_tracker": "https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor/issues", "version": "0.0.0" } \ No newline at end of file diff --git a/custom_components/integration_blueprint/sensor.py b/custom_components/integration_blueprint/sensor.py index 06201fe..84c51db 100644 --- a/custom_components/integration_blueprint/sensor.py +++ b/custom_components/integration_blueprint/sensor.py @@ -1,4 +1,4 @@ -"""Sensor platform for integration_blueprint.""" +"""Sensor platform for limodor_airodor.""" from __future__ import annotations from homeassistant.components.sensor import SensorEntity, SensorEntityDescription @@ -9,7 +9,7 @@ ENTITY_DESCRIPTIONS = ( SensorEntityDescription( - key="integration_blueprint", + key="limodor_airodor", name="Integration Sensor", icon="mdi:format-quote-close", ), @@ -29,7 +29,7 @@ async def async_setup_entry(hass, entry, async_add_devices): class IntegrationBlueprintSensor(IntegrationBlueprintEntity, SensorEntity): - """integration_blueprint Sensor class.""" + """limodor_airodor Sensor class.""" def __init__( self, diff --git a/custom_components/integration_blueprint/switch.py b/custom_components/integration_blueprint/switch.py index 33340a2..a08c0da 100644 --- a/custom_components/integration_blueprint/switch.py +++ b/custom_components/integration_blueprint/switch.py @@ -1,4 +1,4 @@ -"""Switch platform for integration_blueprint.""" +"""Switch platform for limodor_airodor.""" from __future__ import annotations from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription @@ -9,7 +9,7 @@ ENTITY_DESCRIPTIONS = ( SwitchEntityDescription( - key="integration_blueprint", + key="limodor_airodor", name="Integration Switch", icon="mdi:format-quote-close", ), @@ -29,7 +29,7 @@ async def async_setup_entry(hass, entry, async_add_devices): class IntegrationBlueprintSwitch(IntegrationBlueprintEntity, SwitchEntity): - """integration_blueprint switch class.""" + """limodor_airodor switch class.""" def __init__( self, diff --git a/custom_components/integration_blueprint/translations/en.json b/custom_components/integration_blueprint/translations/en.json index 049f7a4..9bf1733 100644 --- a/custom_components/integration_blueprint/translations/en.json +++ b/custom_components/integration_blueprint/translations/en.json @@ -2,7 +2,7 @@ "config": { "step": { "user": { - "description": "If you need help with the configuration have a look here: https://github.com/ludeeus/integration_blueprint", + "description": "If you need help with the configuration have a look here: https://github.com/jschroeter/HomeAssistant-Limodor-AirOdor", "data": { "username": "Username", "password": "Password" diff --git a/hacs.json b/hacs.json index 65f7335..0a098f2 100644 --- a/hacs.json +++ b/hacs.json @@ -1,8 +1,8 @@ { - "name": "Integration blueprint", - "filename": "integration_blueprint.zip", + "name": "LIMODOR AirOdor AD-UV", + "filename": "limodor_airodor.zip", "hide_default_branch": true, - "homeassistant": "2023.3.0", + "homeassistant": "2023.9.0", "render_readme": true, "zip_release": true } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index bb09464..d388a74 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ colorlog==6.7.0 -homeassistant==2023.2.0 -pip>=21.0,<23.2 -ruff==0.0.267 +homeassistant==2023.9.0 diff --git a/scripts/develop b/scripts/develop index 89eda50..2f99e4d 100755 --- a/scripts/develop +++ b/scripts/develop @@ -11,7 +11,7 @@ if [[ ! -d "${PWD}/config" ]]; then fi # Set the path to custom_components -## This let's us have the structure we want /custom_components/integration_blueprint +## This let's us have the structure we want /custom_components/limodor_airodor ## while at the same time have Home Assistant configuration inside /config ## without resulting to symlinks. export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components"