From 0f479d98eb5a6c348f1e6426c1d9ee1263e0dd03 Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 9 Feb 2024 19:41:29 +0100 Subject: [PATCH] Fixed hot water boost switch for VRC700 --- custom_components/mypyllant/switch.py | 10 +++++----- scripts/update-mypyllant | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100755 scripts/update-mypyllant diff --git a/custom_components/mypyllant/switch.py b/custom_components/mypyllant/switch.py index 960296d..ca26e7c 100644 --- a/custom_components/mypyllant/switch.py +++ b/custom_components/mypyllant/switch.py @@ -12,7 +12,7 @@ HolidayEntity, DomesticHotWaterCoordinatorEntity, ) -from myPyllant.enums import DHWCurrentSpecialFunction +from myPyllant.enums import DHWCurrentSpecialFunction, DHWCurrentSpecialFunctionVRC700 from myPyllant.utils import get_default_holiday_dates _LOGGER = logging.getLogger(__name__) @@ -77,10 +77,10 @@ def name(self): @property def is_on(self): - return ( - self.domestic_hot_water.current_special_function - == DHWCurrentSpecialFunction.CYLINDER_BOOST - ) + return self.domestic_hot_water.current_special_function in [ + DHWCurrentSpecialFunction.CYLINDER_BOOST, + DHWCurrentSpecialFunctionVRC700.CYLINDER_BOOST, + ] async def async_turn_on(self, **kwargs): await self.coordinator.api.boost_domestic_hot_water( diff --git a/scripts/update-mypyllant b/scripts/update-mypyllant new file mode 100755 index 0000000..694c18e --- /dev/null +++ b/scripts/update-mypyllant @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." +VERSION=$(git --git-dir=../myPyllant/.git describe --abbrev=0 --tags) +grep -rl "myPyllant==[0-9]" . --exclude-dir=.venv --exclude-dir=.git | xargs sed -i -E "s/myPyllant==[0-9]+.[0-9]+.[0-9]+b?[0-9]*/myPyllant==${VERSION/v/''}/g" \ No newline at end of file