Skip to content

Commit 1b2ec0a

Browse files
initial commit
1 parent 682181d commit 1b2ec0a

28 files changed

+890
-433
lines changed

README.md

Lines changed: 37 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,64 @@
1-
# Notice
2-
3-
The component and platforms in this repository are not meant to be used by a
4-
user, but as a "blueprint" that custom component developers can build
5-
upon, to make more awesome stuff.
6-
7-
HAVE FUN! 😎
8-
9-
## Why?
10-
11-
This is simple, by having custom_components look (README + structure) the same
12-
it is easier for developers to help each other and for users to start using them.
13-
14-
If you are a developer and you want to add things to this "blueprint" that you think more
15-
developers will have use for, please open a PR to add it :)
16-
17-
## What?
18-
19-
This repository contains multiple files, here is a overview:
20-
21-
File | Purpose
22-
-- | --
23-
`.devcontainer/*` | Used for development/testing with VSCODE, more info in the readme file in that dir.
24-
`.github/ISSUE_TEMPLATE/feature_request.md` | Template for Feature Requests
25-
`.github/ISSUE_TEMPLATE/issue.md` | Template for issues
26-
`.vscode/tasks.json` | Tasks for the devcontainer.
27-
`custom_components/integration_blueprint/translations/*` | [Translation files.](https://developers.home-assistant.io/docs/internationalization/custom_integration)
28-
`custom_components/integration_blueprint/__init__.py` | The component file for the integration.
29-
`custom_components/integration_blueprint/api.py` | This is a sample API client.
30-
`custom_components/integration_blueprint/binary_sensor.py` | Binary sensor platform for the integration.
31-
`custom_components/integration_blueprint/config_flow.py` | Config flow file, this adds the UI configuration possibilities.
32-
`custom_components/integration_blueprint/const.py` | A file to hold shared variables/constants for the entire integration.
33-
`custom_components/integration_blueprint/manifest.json` | A [manifest file](https://developers.home-assistant.io/docs/en/creating_integration_manifest.html) for Home Assistant.
34-
`custom_components/integration_blueprint/sensor.py` | Sensor platform for the integration.
35-
`custom_components/integration_blueprint/switch.py` | Switch sensor platform for the integration.
36-
`tests/__init__.py` | Makes the `tests` folder a module.
37-
`tests/conftest.py` | Global [fixtures](https://docs.pytest.org/en/stable/fixture.html) used in tests to [patch](https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch) functions.
38-
`tests/test_api.py` | Tests for `custom_components/integration_blueprint/api.py`.
39-
`tests/test_config_flow.py` | Tests for `custom_components/integration_blueprint/config_flow.py`.
40-
`tests/test_init.py` | Tests for `custom_components/integration_blueprint/__init__.py`.
41-
`tests/test_switch.py` | Tests for `custom_components/integration_blueprint/switch.py`.
42-
`CONTRIBUTING.md` | Guidelines on how to contribute.
43-
`example.png` | Screenshot that demonstrate how it might look in the UI.
44-
`info.md` | An example on a info file (used by [hacs][hacs]).
45-
`LICENSE` | The license file for the project.
46-
`README.md` | The file you are reading now, should contain info about the integration, installation and configuration instructions.
47-
`requirements.txt` | Python packages used by this integration.
48-
`requirements_dev.txt` | Python packages used to provide [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense)/code hints during development of this integration, typically includes packages in `requirements.txt` but may include additional packages
49-
`requirements_test.txt` | Python packages required to run the tests for this integration, typically includes packages in `requirements_dev.txt` but may include additional packages
50-
51-
## How?
52-
53-
If you want to use all the potential and features of this blueprint template you
54-
should use Visual Studio Code to develop in a container. In this container you
55-
will have all the tools to ease your python development and a dedicated Home
56-
Assistant core instance to run your integration. See `.devcontainer/README.md` for more information.
57-
58-
If you need to work on the python library in parallel of this integration
59-
(`sampleclient` in this example) there are different options. The following one seems
60-
easy to implement:
61-
62-
- Create a dedicated branch for your python library on a public git repository (example: branch
63-
`dev` on `https://github.com/ludeeus/sampleclient`)
64-
- Update in the `manifest.json` file the `requirements` key to point on your development branch
65-
( example: `"requirements": ["git+https://github.com/ludeeus/sampleclient.git@dev#devp==0.0.1beta1"]`)
66-
- Each time you need to make a modification to your python library, push it to your
67-
development branch and increase the number of the python library version in `manifest.json` file
68-
to ensure Home Assistant update the code of the python library. (example `"requirements": ["git+https://...==0.0.1beta2"]`).
69-
70-
71-
***
72-
README content if this was a published component:
73-
***
74-
75-
# integration_blueprint
1+
# NPM Switches Custom Integration
762

773
[![GitHub Release][releases-shield]][releases]
4+
![GitHub all releases][download-all]
5+
![GitHub release (latest by SemVer)][download-latest]
786
[![GitHub Activity][commits-shield]][commits]
79-
[![License][license-shield]](LICENSE)
7+
8+
[![License][license-shield]][license]
809

8110
[![hacs][hacsbadge]][hacs]
8211
![Project Maintenance][maintenance-shield]
83-
[![BuyMeCoffee][buymecoffeebadge]][buymecoffee]
84-
85-
[![Discord][discord-shield]][discord]
8612
[![Community Forum][forum-shield]][forum]
8713

88-
_Component to integrate with [integration_blueprint][integration_blueprint]._
89-
90-
**This component will set up the following platforms.**
91-
92-
Platform | Description
93-
-- | --
94-
`binary_sensor` | Show something `True` or `False`.
95-
`sensor` | Show info from blueprint API.
96-
`switch` | Switch something `True` or `False`.
9714

98-
![example][exampleimg]
9915

10016
## Installation
10117

102-
1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`).
103-
2. If you do not have a `custom_components` directory (folder) there, you need to create it.
104-
3. In the `custom_components` directory (folder) create a new folder called `integration_blueprint`.
105-
4. Download _all_ the files from the `custom_components/integration_blueprint/` directory (folder) in this repository.
106-
5. Place the files you downloaded in the new directory (folder) you created.
107-
6. Restart Home Assistant
108-
7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Integration blueprint"
18+
### Recomended via HACs
10919

110-
Using your HA configuration directory (folder) as a starting point you should now also have this:
20+
1. Use [HACS](https://hacs.xyz/docs/setup/download), in `HACS > Integrations > Explore & Add Repositories` search for "NPM Switches".
21+
2. Restart Home Assistant.
22+
3. [![Add Integration][add-integration-badge]][add-integration] or in the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Tesla Custom Integration".
11123

112-
```text
113-
custom_components/integration_blueprint/translations/en.json
114-
custom_components/integration_blueprint/translations/nb.json
115-
custom_components/integration_blueprint/translations/sensor.nb.json
116-
custom_components/integration_blueprint/__init__.py
117-
custom_components/integration_blueprint/api.py
118-
custom_components/integration_blueprint/binary_sensor.py
119-
custom_components/integration_blueprint/config_flow.py
120-
custom_components/integration_blueprint/const.py
121-
custom_components/integration_blueprint/manifest.json
122-
custom_components/integration_blueprint/sensor.py
123-
custom_components/integration_blueprint/switch.py
124-
```
24+
### Manual Download
25+
1. Use the tool of choice to open the directory (folder) for your HA configuration (where you find `configuration.yaml`).
26+
3. If you do not have a `custom_components` directory (folder) there, you need to create it.
27+
4. Download this repository's files.
28+
5. Move or Copy the the entire `npm_switches/` directory (folder) in your HA `custom_components` directory (folder). End result should look like `custom_components/npm_switches/`.
29+
6. Restart Home Assistant.
30+
7. [![Add Integration][add-integration-badge]][add-integration] or in the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Tesla Custom Integration".
12531

126-
## Configuration is done in the UI
32+
## Usage
12733

128-
<!---->
34+
'NPM Switches' offers integration with a local Nginx Proxy Manager server/instance. It will login into and retrieve a token from the NPM server every 24 hours. This token is used to querry the state of each proxy host every 60 seconds. It is also used to enable or disable a proxy host via local api call to the NPM server.
12935

130-
## Contributions are welcome!
36+
This integration provides the following entities:
37+
- Switches - One switch for every proxy host that is configured
38+
- Sensors - Number of enabled proxy hosts, number of disabled proxy hosts
39+
40+
Future features could include redirection host switches and 404 host switches.
13141

13242
If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md)
13343

44+
_Component built with [integration_blueprint][integration_blueprint]._
45+
13446
***
13547

13648
[integration_blueprint]: https://github.com/custom-components/integration_blueprint
137-
[buymecoffee]: https://www.buymeacoffee.com/ludeeus
138-
[buymecoffeebadge]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg?style=for-the-badge
139-
[commits-shield]: https://img.shields.io/github/commit-activity/y/custom-components/blueprint.svg?style=for-the-badge
140-
[commits]: https://github.com/custom-components/integration_blueprint/commits/master
49+
[commits-shield]: https://img.shields.io/github/commit-activity/w/InTheDaylight14/nginx-proxy-manager-switches?style=for-the-badge
50+
[commits]: https://github.com/InTheDaylight14/nginx-proxy-manager-switches/commits/master
14151
[hacs]: https://github.com/custom-components/hacs
14252
[hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge
143-
[discord]: https://discord.gg/Qa5fW2R
144-
[discord-shield]: https://img.shields.io/discord/330944238910963714.svg?style=for-the-badge
145-
[exampleimg]: example.png
53+
<!-- [exampleimg]: example.png -->
14654
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg?style=for-the-badge
14755
[forum]: https://community.home-assistant.io/
148-
[license-shield]: https://img.shields.io/github/license/custom-components/blueprint.svg?style=for-the-badge
149-
[maintenance-shield]: https://img.shields.io/badge/maintainer-Joakim%20Sørensen%20%40ludeeus-blue.svg?style=for-the-badge
150-
[releases-shield]: https://img.shields.io/github/release/custom-components/blueprint.svg?style=for-the-badge
151-
[releases]: https://github.com/custom-components/integration_blueprint/releases
56+
[license]: LICENSE
57+
[license-shield]: https://img.shields.io/github/license/InTheDaylight14/nginx-proxy-manager-switches?style=for-the-badge
58+
[maintenance-shield]: https://img.shields.io/badge/[email protected]?style=for-the-badge
59+
[releases-shield]: https://img.shields.io/github/release/InTheDaylight14/nginx-proxy-manager-switches?style=for-the-badge
60+
[releases]: https://github.com/InTheDaylight14/nginx-proxy-manager-switches/releases
61+
[add-integration]: https://my.home-assistant.io/redirect/config_flow_start?domain=npm_switches
62+
[add-integration-badge]: https://my.home-assistant.io/badges/config_flow_start.svg
63+
[download-all]: https://img.shields.io/github/downloads/InTheDaylight14/nginx-proxy-manager-switches/total?style=for-the-badge
64+
[download-latest]: https://img.shields.io/github/downloads/InTheDaylight14/nginx-proxy-manager-switches/latest/total?style=for-the-badge

custom_components/integration_blueprint/api.py

Lines changed: 0 additions & 75 deletions
This file was deleted.

custom_components/integration_blueprint/binary_sensor.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

custom_components/integration_blueprint/manifest.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

custom_components/integration_blueprint/sensor.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

custom_components/integration_blueprint/switch.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)