From b7c162aaef4effdd7c1d60707e7f670f23c94767 Mon Sep 17 00:00:00 2001 From: Patrick762 Date: Thu, 4 Jan 2024 16:02:49 +0100 Subject: [PATCH] updated readme --- README.md | 3 +-- custom_components/bluetti_bt/__init__.py | 12 +++++++++++- custom_components/bluetti_bt/coordinator.py | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e9d402a..ce86d3d 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,7 @@ After the installation, you can use this button to install the integration: - EP600 (tested) ### Available sensors: -All sensors which are available in bluetti_mqtt (Based on [this file](https://github.com/warhammerkid/bluetti_mqtt/blob/main/bluetti_mqtt/mqtt_client.py)) -excluding battery pack fields. +All sensors which are available in bluetti_mqtt (Based on [this file](https://github.com/warhammerkid/bluetti_mqtt/blob/main/bluetti_mqtt/mqtt_client.py)). ### Available controls: If enabled in the Integration options (you need to reload the integration if you change this option): diff --git a/custom_components/bluetti_bt/__init__.py b/custom_components/bluetti_bt/__init__.py index 45b7765..8b69d58 100644 --- a/custom_components/bluetti_bt/__init__.py +++ b/custom_components/bluetti_bt/__init__.py @@ -12,7 +12,17 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity import DeviceInfo from homeassistant.exceptions import ConfigEntryNotReady -from .const import CONF_MAX_RETRIES, CONF_PERSISTENT_CONN, CONF_POLLING_INTERVAL, CONF_POLLING_TIMEOUT, DATA_COORDINATOR, DOMAIN, MANUFACTURER, CONF_USE_CONTROLS, DATA_POLLING_RUNNING +from .const import ( + CONF_MAX_RETRIES, + CONF_PERSISTENT_CONN, + CONF_POLLING_INTERVAL, + CONF_POLLING_TIMEOUT, + CONF_USE_CONTROLS, + DATA_COORDINATOR, + DATA_POLLING_RUNNING, + DOMAIN, + MANUFACTURER, +) from .coordinator import PollingCoordinator PLATFORMS: [Platform] = [Platform.BINARY_SENSOR, Platform.SENSOR] diff --git a/custom_components/bluetti_bt/coordinator.py b/custom_components/bluetti_bt/coordinator.py index ef87053..8239c64 100644 --- a/custom_components/bluetti_bt/coordinator.py +++ b/custom_components/bluetti_bt/coordinator.py @@ -231,7 +231,7 @@ class PollingCoordinator(DataUpdateCoordinator): # Set current pack number await self.async_send_command( self.bluetti_device.build_setter_command('pack_num', pack) - ) + ) for command in self.bluetti_device.pack_polling_commands: # Request & parse result for each pack @@ -311,7 +311,7 @@ class PollingCoordinator(DataUpdateCoordinator): self.logger.warning( "Needed to disconnect due to error: %s (This can also be the case if you used device controls)", err ) - + # caught an exception, return empty bytes object return bytes()