From 54f1ebeda3d763afc168b6a10432406812900b8d Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 29 Jul 2021 21:30:41 +0300 Subject: [PATCH] fix some issues with brightness after restart --- custom_components/mega/entities.py | 2 +- custom_components/mega/manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/mega/entities.py b/custom_components/mega/entities.py index 70dabeb..b8bc7c7 100644 --- a/custom_components/mega/entities.py +++ b/custom_components/mega/entities.py @@ -421,7 +421,7 @@ class MegaOutPort(MegaPushEntity): self._last_called = time.time() if not self.dimmer: transition = None - if not self.is_on: + if not self.is_on and (brightness is None or brightness == 0): brightness = self._restore_brightness brightness = brightness or self.brightness or 255 _prev = safe_int(self.brightness) or 0 diff --git a/custom_components/mega/manifest.json b/custom_components/mega/manifest.json index 74d86d7..e5721f6 100644 --- a/custom_components/mega/manifest.json +++ b/custom_components/mega/manifest.json @@ -15,5 +15,5 @@ "@andvikt" ], "issue_tracker": "https://github.com/andvikt/mega_hacs/issues", - "version": "v1.0.7" + "version": "v1.0.8" } \ No newline at end of file