diff --git a/README.md b/README.md index 6929c82..bbff25d 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,31 @@ _Component to integrate with [powerpal][powerpal]._ -**This component will set up the following platforms.** +_This repository and integration is not affiliated with Powerpal._ + +**This component will set up the following platforms and entities.** Platform | Description -- | -- -`sensor` | Show info from powerpal API. +`sensor` | Show info from Powerpal Readings API. + +Entity | Description +-- | -- +`sensor.powerpal_live_consumption` | Current reading from Powerpal Readings API (updated every minute). +`sensor.powerpal_total_consumption` | Total consumption recorded by Powerpal - entity can be used in Energy Dashboard. + +![sensor][sensorimg] + +![energy][energyimg] + +## Automatic Installation -![example][exampleimg] +1. Install HACS +2. Within HA go to HACS > Integrations > ... (in top right corner) > Custom Repositories +3. Add URL: `https://github.com/mindmelting/hass-powerpal`, Category: `Integration` +4. Go to the integrations page inside your home assistant install +5. Search for `Powerpal` +6. Install, enter your Powerpal API Authorization Key and Powerpal Device ID. ## Manual Installation @@ -23,7 +41,7 @@ Platform | Description 4. Download _all_ the files from the `custom_components/powerpal/` directory (folder) in this repository. 5. Place the files you downloaded in the new directory (folder) you created. 6. Restart Home Assistant -7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Powerpal" +7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for `Powerpal` Using your HA configuration directory (folder) as a starting point you should now also have this: @@ -40,7 +58,7 @@ custom_components/powerpal/sensor.py -## Contributions are welcome! +## Contributions are welcome If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md) @@ -53,4 +71,5 @@ If you want to contribute to this please read the [Contribution guidelines](CONT [hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge [releases-shield]: https://img.shields.io/github/release/mindmelting/hass-powerpal.svg?style=for-the-badge [releases]: https://github.com/mindmelting/hass-powerpal/releases -[exampleimg]: example.png +[sensorimg]: sensor.png +[energyimg]: energy.png diff --git a/custom_components/powerpal/__init__.py b/custom_components/powerpal/__init__.py index 3e8b63d..d022200 100644 --- a/custom_components/powerpal/__init__.py +++ b/custom_components/powerpal/__init__.py @@ -14,7 +14,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed -from powerpal import Powerpal +from mindmelting.powerpal import Powerpal from .const import ( CONF_AUTH_KEY, diff --git a/custom_components/powerpal/config_flow.py b/custom_components/powerpal/config_flow.py index bce3d8d..d856f81 100644 --- a/custom_components/powerpal/config_flow.py +++ b/custom_components/powerpal/config_flow.py @@ -4,7 +4,7 @@ from homeassistant.helpers.aiohttp_client import async_create_clientsession import voluptuous as vol -from powerpal import Powerpal +from mindmelting.powerpal import Powerpal from .const import ( CONF_DEVICE_ID, diff --git a/custom_components/powerpal/const.py b/custom_components/powerpal/const.py index 8a25264..dfbabbd 100644 --- a/custom_components/powerpal/const.py +++ b/custom_components/powerpal/const.py @@ -3,7 +3,7 @@ NAME = "Powerpal" DOMAIN = "powerpal" DOMAIN_DATA = f"{DOMAIN}_data" -VERSION = "0.1.0" +VERSION = "0.2.0" ATTRIBUTION = "Data provided by https://readings.powerpal.net" ISSUE_URL = "https://github.com/mindmelting/hass-powerpal/issues" diff --git a/custom_components/powerpal/manifest.json b/custom_components/powerpal/manifest.json index 6c32f30..c3f4b32 100644 --- a/custom_components/powerpal/manifest.json +++ b/custom_components/powerpal/manifest.json @@ -9,5 +9,5 @@ "codeowners": [ "@mindmelting" ], - "requirements": ["powerpal==0.2.0"] + "requirements": ["mindmelting.powerpal==0.3.0"] } \ No newline at end of file diff --git a/energy.png b/energy.png new file mode 100644 index 0000000..d9afe6c Binary files /dev/null and b/energy.png differ diff --git a/info.md b/info.md index dda34f5..b8901ba 100644 --- a/info.md +++ b/info.md @@ -6,13 +6,22 @@ _Component to integrate with [powerpal][powerpal]._ +_This repository and integration is not affiliated with Powerpal._ + **This component will set up the following platforms.** Platform | Description -- | -- -`sensor` | Show info from Powerpal API. +`sensor` | Show info from Powerpal Readings API. + +Entity | Description +-- | -- +`sensor.powerpal_live_consumption` | Current reading from Powerpal Readings API (updated every minute). +`sensor.powerpal_total_consumption` | Total consumption recorded by Powerpal - entity can be used in Energy Dashboard. -![example][exampleimg] +![sensor][sensorimg] + +![energy][energyimg] {% if not installed %} @@ -23,7 +32,6 @@ Platform | Description {% endif %} - ## Configuration is done in the UI @@ -37,4 +45,5 @@ Platform | Description [hacsbadge]: https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge [releases-shield]: https://img.shields.io/github/release/mindmelting/hass-powerpal.svg?style=for-the-badge [releases]: https://github.com/mindmelting/hass-powerpal/releases -[exampleimg]: example.png \ No newline at end of file +[sensorimg]: sensor.png +[energyimg]: energy.png \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index b096a11..32b8e2b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -powerpal==0.2.0 \ No newline at end of file +mindmelting.powerpal==0.3.0 \ No newline at end of file diff --git a/requirements_dev.txt b/requirements_dev.txt index 7489dfb..ecd0adb 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,2 +1,2 @@ homeassistant -powerpal==0.2.0 \ No newline at end of file +mindmelting.powerpal==0.3.0 \ No newline at end of file diff --git a/requirements_test.txt b/requirements_test.txt index acdb7fd..61309e1 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,2 +1,2 @@ pytest-homeassistant-custom-component==0.4.0 -powerpal==0.2.0 \ No newline at end of file +mindmelting.powerpal==0.3.0 \ No newline at end of file diff --git a/example.png b/sensor.png similarity index 100% rename from example.png rename to sensor.png diff --git a/tests/conftest.py b/tests/conftest.py index b3d2c35..d4675ef 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -45,9 +45,7 @@ def skip_notifications_fixture(): @pytest.fixture(name="bypass_get_data") def bypass_get_data_fixture(): """Skip calls to get data from API.""" - with patch( - "powerpal.Powerpal.get_data" - ): + with patch("mindmelting.powerpal.Powerpal.get_data"): yield @@ -57,7 +55,7 @@ def bypass_get_data_fixture(): def error_get_data_fixture(): """Simulate error when retrieving data from API.""" with patch( - "powerpal.Powerpal.get_data", + "mindmelting.powerpal.Powerpal.get_data", side_effect=Exception, ): yield