Skip to content

Commit

Permalink
Version 0.1.28-1
Browse files Browse the repository at this point in the history
- Fix issue mak-gitdev/HA_enoceanmqtt#106
- Fix issue on string comparison for MQTT device name in entity.
  • Loading branch information
mak-gitdev committed Dec 13, 2023
1 parent 809a86e commit a4a01d7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
8 changes: 8 additions & 0 deletions addon-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.1.28-1

**Fix installation issue reported in mak-gitdev/ha_enoceanmqtt#106**
**Fix version comparison related to MQTT device name in entity (mak-gitdev/ha_enoceanmqtt#77)**

It is not required to install this version if none of the fixes above is of interest for you.
**If you want to upgrade to this version, I can all but recommend to make a backup before.**

## 0.1.28

**Important**: Add a new cover entity (cover2) for D2-05-00. This should fix inverted position issue (thanks to @didi31).
Expand Down
2 changes: 2 additions & 0 deletions addon-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ WORKDIR /app

# Install enoceanmqtt and requirements
RUN apk add --no-cache python3 py3-pip git && \
python3 -m venv /app/venv && \
. /app/venv/bin/activate && \
python3 -m pip install --upgrade pip && \
pip3 install pyyaml && \
pip3 install tinydb && \
Expand Down
2 changes: 1 addition & 1 deletion addon-dev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "EnOcean MQTT (dev)"
description: "EnOcean to MQTT bridge for Home Assistant"
url: "https://github.com/mak-gitdev/HA_enoceanmqtt-addon"
version: "0.1.28"
version: "0.1.28-1"
slug: "ha_enoceanmqtt_dev"
stage: "experimental"
init: false
Expand Down
25 changes: 19 additions & 6 deletions addon-dev/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,26 @@ fi

# Device name in entity name
HA_VERSION="$(bashio::core.version)"
Year=$(echo ${HA_VERSION//[!0-9.]/} | cut -d '.' -f 1)
Month=$(echo ${HA_VERSION//[!0-9.]/} | cut -d '.' -f 2)

if [ "${HA_VERSION}" \> "2023.8" ] || [ "${HA_VERSION}" \= "2023.8" ]; then
if [ "${HA_VERSION}" \> "2024.2" ] || [ "${HA_VERSION}" \= "2024.2" ]; then
bashio::log.green "Overwrite use_dev_name_in_entity to FALSE"
USE_DEV_NAME_IN_ENTITY="False"
if [ ${Year} -ge 2023 ]; then
if [ ${Year} -eq 2023 ]; then
if [ ${Month} -lt 8 ]; then
bashio::log.green "Overwrite use_dev_name_in_entity to TRUE"
USE_DEV_NAME_IN_ENTITY="True"
else
USE_DEV_NAME_IN_ENTITY="$(bashio::config 'use_dev_name_in_entity')"
bashio::log.green "use_dev_name_in_entity is USER-DEFINED (${USE_DEV_NAME_IN_ENTITY})"
fi
else
USE_DEV_NAME_IN_ENTITY="$(bashio::config 'use_dev_name_in_entity')"
bashio::log.green "use_dev_name_in_entity is USER-DEFINED (${USE_DEV_NAME_IN_ENTITY})"
if [ ${Year} -eq 2024 ] && [ ${Month} -lt 2 ]; then
USE_DEV_NAME_IN_ENTITY="$(bashio::config 'use_dev_name_in_entity')"
bashio::log.green "use_dev_name_in_entity is USER-DEFINED (${USE_DEV_NAME_IN_ENTITY})"
else
bashio::log.green "Overwrite use_dev_name_in_entity to FALSE"
USE_DEV_NAME_IN_ENTITY="False"
fi
fi
else
bashio::log.green "Overwrite use_dev_name_in_entity to TRUE"
Expand Down Expand Up @@ -119,4 +131,5 @@ if ! bashio::config.is_empty 'eep_file'; then
fi

bashio::log.green "Starting EnOceanMQTT..."
. /app/venv/bin/activate
enoceanmqtt $DEBUG_FLAG --logfile $LOG_FILE $CONFIG_FILE

0 comments on commit a4a01d7

Please sign in to comment.