From 3d6fbd9ca9c1874f1db96949f40147fae73b787f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 04:14:39 +0000 Subject: [PATCH 1/2] build(deps): bump pytest-homeassistant-custom-component Bumps [pytest-homeassistant-custom-component](https://github.com/MatthewFlamm/pytest-homeassistant-custom-component) from 0.6.2 to 0.7.3. - [Release notes](https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/releases) - [Changelog](https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/blob/master/CHANGELOG.md) - [Commits](https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/compare/0.6.2...0.7.3) --- updated-dependencies: - dependency-name: pytest-homeassistant-custom-component dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.test.txt b/requirements.test.txt index a844598..cca39d7 100644 --- a/requirements.test.txt +++ b/requirements.test.txt @@ -1,6 +1,6 @@ # Strictly for tests # TODO: Replace master-branch version when a new release is available -pytest-homeassistant-custom-component==0.6.2 +pytest-homeassistant-custom-component==0.7.3 # From our manifest.json for our custom component aiohttp_cors==0.7.0 paho-mqtt==1.6.1 From 1ac896ffc7d594292daf04cf3554bc092b34c8d4 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Tue, 15 Mar 2022 08:00:40 +0100 Subject: [PATCH 2/2] fix: mark sensor as added to HASS even if no existing state is found --- custom_components/ferroamp/sensor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/ferroamp/sensor.py b/custom_components/ferroamp/sensor.py index 08f52a3..16b4ddc 100644 --- a/custom_components/ferroamp/sensor.py +++ b/custom_components/ferroamp/sensor.py @@ -594,9 +594,8 @@ async def async_added_to_hass(self) -> None: """Handle entity which will be added.""" await super().async_added_to_hass() state = await self.async_get_last_state() - if not state: - return - self._attr_native_value = state.state + if state: + self._attr_native_value = state.state self.hass.data[DOMAIN][DATA_DEVICES][self.config_id][self.device_id][self.unique_id] = self self._added = True