Skip to content

Commit

Permalink
chore: Update to namespaced lib and updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mindmelting authored Oct 5, 2021
2 parents c44049f + 1584a39 commit f7e8b30
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 21 deletions.
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:

Expand All @@ -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)

Expand All @@ -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
2 changes: 1 addition & 1 deletion custom_components/powerpal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/powerpal/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/powerpal/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion custom_components/powerpal/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"codeowners": [
"@mindmelting"
],
"requirements": ["powerpal==0.2.0"]
"requirements": ["mindmelting.powerpal==0.3.0"]
}
Binary file added energy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

Expand All @@ -23,7 +32,6 @@ Platform | Description

{% endif %}


## Configuration is done in the UI

<!---->
Expand All @@ -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
[sensorimg]: sensor.png
[energyimg]: energy.png
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
powerpal==0.2.0
mindmelting.powerpal==0.3.0
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
homeassistant
powerpal==0.2.0
mindmelting.powerpal==0.3.0
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest-homeassistant-custom-component==0.4.0
powerpal==0.2.0
mindmelting.powerpal==0.3.0
File renamed without changes
6 changes: 2 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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

0 comments on commit f7e8b30

Please sign in to comment.