Skip to content

Commit 37dec72

Browse files
authored
Merge pull request #16 from Angelius007/fix_mqtt
Fix mqtt
2 parents 4fa186f + 15f7918 commit 37dec72

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

custom_components/ecoflow_cloud/devices/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class EcoflowDeviceInfo:
2121
name: str
2222
device_type: str
2323
client_id: str
24-
data_topic: str
25-
set_topic: str
26-
set_reply_topic: str
27-
get_topic: str | None
28-
get_reply_topic: str | None
24+
data_topic: str | None = None
25+
set_topic: str | None = None
26+
set_reply_topic: str | None = None
27+
get_topic: str | None = None
28+
get_reply_topic: str | None = None
2929
status_topic: str | None = None
3030
client_id: str | None = None
3131

custom_components/ecoflow_cloud/devices/data_holder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def add_get_reply_message(self, msg: dict[str, Any]):
7575
def update_to_target_state(self, target_state: dict[str, Any]):
7676
# key can be xpath!
7777
for key, value in target_state.items():
78-
expr = jp.parse("'"+key+"'")
79-
expr.update(self.params, value)
78+
jp.parse(key).update(self.params, value)
8079

8180
self.__broadcast()
8281

custom_components/ecoflow_cloud/devices/internal/powerstream.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from homeassistant.util import utcnow
44

5-
from custom_components.ecoflow_cloud.devices import const, BaseDevice
5+
from custom_components.ecoflow_cloud.devices import BaseDevice
66
from custom_components.ecoflow_cloud.entities import (
77
BaseSensorEntity, BaseNumberEntity, BaseSelectEntity, BaseSwitchEntity
88
)
@@ -12,8 +12,6 @@
1212
DecivoltSensorEntity, InWattsSolarSensorEntity, LevelSensorEntity,
1313
MiscSensorEntity, RemainSensorEntity, StatusSensorEntity,
1414
)
15-
from custom_components.ecoflow_cloud.number import DeciChargingPowerEntity, MinBatteryLevelEntity, MaxBatteryLevelEntity, BrightnessLevelEntity
16-
from custom_components.ecoflow_cloud.select import PowerDictSelectEntity
1715
from ...api import EcoflowApiClient
1816

1917
_LOGGER = logging.getLogger(__name__)

0 commit comments

Comments
 (0)