Skip to content

Commit

Permalink
Merge pull request #73 from jmcruvellier/dev
Browse files Browse the repository at this point in the history
v1.2.0 code release
  • Loading branch information
jmcruvellier authored Feb 10, 2024
2 parents 2595e10 + c71d3e2 commit a295239
Show file tree
Hide file tree
Showing 15 changed files with 283 additions and 818 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.2.0
- Major code and performance optimization
- Removed sensors introduced in v1.1.0 based on ecojoko Measurements APIs
- Bug fix [#58](https://github.com/jmcruvellier/little_monkey/issues/58)

## 1.1.0
- New sensors based on ecojoko Measurements APIs
- Some performance improvement and minor bug fixes
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ Elle intègre dans Home Assistant les capteurs suivants:
| 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
8 changes: 6 additions & 2 deletions custom_components/little_monkey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .const import (
DOMAIN,
PLATFORMS,
CONF_USE_LAST_MEASURE_FEATURE,
POLL_INTERVAL,
CONF_USE_HCHP_FEATURE,
CONF_USE_TEMPO_FEATURE,
CONF_USE_TEMPHUM_FEATURE,
Expand All @@ -26,6 +26,10 @@ 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_int(array, index):
"""Read the value with a default of -1 if the key is not found."""
return array.get(index, -1)

def get_string(array, index):
"""Read the value with a default of empty string if the key is not found."""
return array.get(index, "")
Expand All @@ -41,7 +45,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
client=LittleMonkeyApiClient(
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),
poll_interval=get_int(entry.data, POLL_INTERVAL),
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),
Expand Down
Loading

0 comments on commit a295239

Please sign in to comment.