From 436eb6cd0a6b7fcdbc8b4b0c52a30b8bbce38656 Mon Sep 17 00:00:00 2001 From: Michael Meli Date: Thu, 4 May 2023 09:26:32 -0400 Subject: [PATCH] update to async_write_ha_state and add deprecation warning --- README.md | 6 +++++- custom_components/duke_energy_gateway/manifest.json | 2 +- custom_components/duke_energy_gateway/sensor.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f4a425e..61d6497 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,11 @@ This is a custom integration for [Home Assistant](https://www.home-assistant.io/ This integration leverages the [`pyduke-energy`](https://github.com/mjmeli/pyduke-energy) library, also written by me, to pull data. This API is _very_ unofficial and may stop working at any time (see [Disclaimer](https://github.com/mjmeli/pyduke-energy#Disclaimer)). -## IMPORTANT Pre-Requisites! (Please Read) +## IMPORTANT - Deprecation Warning + +Duke Energy is shutting down the Gateway pilot program at the end of June. This integration will stop functioning and will be deprecated. + +## Pre-Requisites! (Please Read) You are required to have a Duke Energy Gateway connected to your smartmeter for this to work. This is a **separate** device than your Smart Meter and is provided by an invitation only program at the moment. If you don't know what this is, then you probably don't have it. This integration does not support any other method of retrieving data (see [Gateway Requirement](https://github.com/mjmeli/pyduke-energy#gateway-requirement)). diff --git a/custom_components/duke_energy_gateway/manifest.json b/custom_components/duke_energy_gateway/manifest.json index ae06a86..3a39dd7 100644 --- a/custom_components/duke_energy_gateway/manifest.json +++ b/custom_components/duke_energy_gateway/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/mjmeli/ha-duke-energy-gateway/issues", "requirements": ["pyduke-energy==1.0.5"], - "version": "0.1.4" + "version": "0.1.5" } diff --git a/custom_components/duke_energy_gateway/sensor.py b/custom_components/duke_energy_gateway/sensor.py index cdd71ac..0e0f421 100644 --- a/custom_components/duke_energy_gateway/sensor.py +++ b/custom_components/duke_energy_gateway/sensor.py @@ -200,7 +200,7 @@ async def async_added_to_hass(self): async def async_on_new_measurement(measurement: RealtimeUsageMeasurement): _LOGGER.debug("New measurement received: %f", measurement.usage) self._state = measurement.usage - await self.async_update_ha_state() + await self.async_write_ha_state() # Attach subscriber callback self._coordinator.async_realtime_subscribe_to_dispatcher(