Skip to content

Commit

Permalink
Merge pull request #72 from jmcruvellier/dev
Browse files Browse the repository at this point in the history
Version 1.1.0
  • Loading branch information
jmcruvellier committed Feb 4, 2024
2 parents e0a47df + 077bb70 commit 2595e10
Show file tree
Hide file tree
Showing 14 changed files with 411 additions and 187 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.1.0
- New sensors based on ecojoko Measurements APIs
- Some performance improvement and minor bug fixes
- Bug fix [#58](https://github.com/jmcruvellier/little_monkey/issues/58)
- Bug fix [#71](https://github.com/jmcruvellier/little_monkey/issues/71)

## 1.0.1

- Bug fix [#67](https://github.com/jmcruvellier/little_monkey/issues/67)
Expand Down
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
[![CodeQL](https://github.com/jmcruvellier/little_monkey/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/jmcruvellier/little_monkey/actions/workflows/github-code-scanning/codeql)
[![HACS](https://github.com/jmcruvellier/little_monkey/actions/workflows/hacs.yaml/badge.svg)](https://github.com/jmcruvellier/little_monkey/actions/workflows/hacs.yaml)
[![hassfest](https://github.com/jmcruvellier/little_monkey/actions/workflows/hassfest.yaml/badge.svg)](https://github.com/jmcruvellier/little_monkey/actions/workflows/hassfest.yaml)
[![Validate](https://github.com/jmcruvellier/little_monkey/actions/workflows/validate.yml/badge.svg)](https://github.com/jmcruvellier/little_monkey/actions/workflows/validate.yml)

![](/custom_components/little_monkey/res/logo_small.png)
# Little Monkey / Petit Singe

Cette intégration vous permet de récupérer les informations collectées par votre installation ecojoko<sup>©️</sup>.

Elle intègre dans Home Assistant les capteurs suivants:

* Consommation Temps Réel (Puissance en W)
* Consommation Réseau (Energie en kWh)
* Si vous avez un contrat d'énergie HC/HP
- Consommation HC Réseau (Energie en kWh)
- Consommation HP Réseau (Energie en kWh)
- Si c'est un contrat Tempo:
- Consommation HC Bleu Réseau (Energie en kWh)
- Consommation HP Bleu Réseau (Energie en kWh)
- Consommation HC Blanc Réseau (Energie en kWh)
- Consommation HP Blanc Réseau (Energie en kWh)
- Consommation HC Rouge Réseau (Energie en kWh)
- Consommation HP Rouge Réseau (Energie en kWh)
* Si vous êtes producteur d'énergie grâce à des panneaux photovoltaïques et possesseur d'un capteur ecojoko ancienne génération:
- Surplus de Production (Energie en kWh)
* Température Intérieure (en °C)
* Température Extérieure (en °C)
* Humidité Intérieure (en %)
* Humidité Extérieure (en %)
| Version | Capteur | Type | Unité | Disponibilité | Commentaire |
| ------- | ------- | ---- | ----- | ------------- | ----------- |
| 1.0.0 | Consommation Temps Réel | Puissance | W | Permanent | |
| 1.0.0 | Consommation Réseau | Energie | kWh | Permanent | |
| 1.0.0 | Consommation HC Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie incluant les HC/HP |
| 1.0.0 | Consommation HP Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie incluant les HC/HP |
| 1.0.0 | Consommation HC Bleu Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie Tempo |
| 1.0.0 | Consommation HP Bleu Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie Tempo |
| 1.0.0 | Consommation HC Blanc Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie Tempo |
| 1.0.0 | Consommation HP Blanc Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie Tempo |
| 1.0.0 | Consommation HC Rouge Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie Tempo |
| 1.0.0 | Consommation HP Rouge Réseau | Energie | kWh | Optionnel | Si vous avez un contrat d'énergie Tempo |
| 1.0.0 | Surplus de Production | Energie | kWh | Optionnel | Si vous êtes producteur d'énergie grâce à des panneaux photovoltaïques et possesseur d'un capteur ecojoko ancienne génération |
| 1.0.0 | Température Intérieure | Température | °C | Optionnel | |
| 1.0.0 | Température Extérieure | Température | °C | Optionnel | |
| 1.0.0 | Humidité Intérieure | Humidité | % | Optionnel | |
| 1.0.0 | Humidité Extérieure | Humidité | % | Optionnel | |
| 1.1.0 | Consommation Dernière Mesure | Puissance | W | Optionnel | Dernière valeur retournée dans la section Mesures de l'application ecojoko |
| 1.1.0 | Consommation Réseau Dernière Mesure | Energie | kWh | Optionnel | Dernière valeur retournée dans la section Mesures de l'application ecojoko |
| 1.1.0 | Consommation HC Réseau Dernière Mesure | Energie | kWh | Optionnel | Dernière valeur retournée dans la section Mesures de l'application ecojoko |
| 1.1.0 | Consommation HP Réseau Dernière Mesure | Energie | kWh | Optionnel | Dernière valeur retournée dans la section Mesures de l'application ecojoko |

> [!IMPORTANT]
> Si vous êtes un utilisateur régulier de l'application ecojoko<sup>©️</sup>, vous n'êtes pas sans savoir que le petit singe glisse souvent sur sa peau de banane. **Cette __intégration non-officielle__ dépend des APIs d'ecojoko<sup>©️</sup> et n'est donc pas responsable en cas d'indisponibilité de vos donnés.**
Expand Down
23 changes: 17 additions & 6 deletions custom_components/little_monkey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@
from .const import (
DOMAIN,
PLATFORMS,
CONF_USE_LAST_MEASURE_FEATURE,
CONF_USE_HCHP_FEATURE,
CONF_USE_TEMPO_FEATURE,
CONF_USE_TEMPHUM_FEATURE,
CONF_USE_PROD_FEATURE
)
from .coordinator import LittleMonkeyDataUpdateCoordinator

def get_boolean(array, index):
"""Read the value with a default of False if the key is not found."""
return array.get(index, False)

def get_string(array, index):
"""Read the value with a default of empty string if the key is not found."""
return array.get(index, "")


# https://developers.home-assistant.io/docs/config_entries_index/#setting-up-an-entry
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up this integration using UI."""
Expand All @@ -29,12 +39,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass=hass,
entry=entry,
client=LittleMonkeyApiClient(
username=entry.data[CONF_USERNAME],
password=entry.data[CONF_PASSWORD],
use_hchp=entry.data[CONF_USE_HCHP_FEATURE],
use_tempo=entry.data[CONF_USE_TEMPO_FEATURE],
use_temphum=entry.data[CONF_USE_TEMPHUM_FEATURE],
use_prod=entry.data[CONF_USE_PROD_FEATURE],
username=get_string(entry.data, CONF_USERNAME),
password=get_string(entry.data, CONF_PASSWORD),
use_last_measure=get_boolean(entry.data, CONF_USE_LAST_MEASURE_FEATURE),
use_hchp=get_boolean(entry.data, CONF_USE_HCHP_FEATURE),
use_tempo=get_boolean(entry.data, CONF_USE_TEMPO_FEATURE),
use_temphum=get_boolean(entry.data, CONF_USE_TEMPHUM_FEATURE),
use_prod=get_boolean(entry.data, CONF_USE_PROD_FEATURE),
session=async_get_clientsession(hass),
),
)
Expand Down

0 comments on commit 2595e10

Please sign in to comment.