Skip to content

Commit 58f27fb

Browse files
committed
Return to devices in the output data
1 parent bfffb41 commit 58f27fb

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def get_all_gateway_entities(self) -> None:
308308

309309
async def async_update(self) -> PlugwiseData:
310310
"""Update the various entities and their states."""
311-
data = PlugwiseData(entities={}, gateway={})
311+
data = PlugwiseData(devices={}, gateway={})
312312
try:
313313
data = await self._smile_api.async_update()
314314
self.gateway_id = data.gateway["gateway_id"]

plugwise/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,6 @@ class GwEntityData(TypedDict, total=False):
582582
class PlugwiseData:
583583
"""Plugwise data provided as output."""
584584

585-
entities: dict[str, GwEntityData]
585+
devices: dict[str, GwEntityData]
586586
gateway: GatewayData
587587

plugwise/legacy/smile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ async def async_update(self) -> PlugwiseData:
134134

135135
self._previous_day_number = day_number
136136
return PlugwiseData(
137-
entities=self.gw_entities,
137+
devices=self.gw_entities,
138138
gateway=self.gw_data,
139139
)
140140

plugwise/smile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async def async_update(self) -> PlugwiseData:
140140
raise DataMissingError("No Plugwise data received") from err
141141

142142
return PlugwiseData(
143-
entities=self.gw_entities,
143+
devices=self.gw_entities,
144144
gateway=self.gw_data,
145145
)
146146

tests/test_init.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -628,34 +628,34 @@ def test_and_assert(test_dict, data, header):
628628
self._cooling_active = False
629629
self._cooling_enabled = False
630630
if "heater_id" in data.gateway:
631-
heat_cooler = data.entities[data.gateway["heater_id"]]
631+
heat_cooler = data.devices[data.gateway["heater_id"]]
632632
if "binary_sensors" in heat_cooler:
633633
if "cooling_enabled" in heat_cooler["binary_sensors"]:
634634
self._cooling_enabled = heat_cooler["binary_sensors"]["cooling_enabled"]
635635
if "cooling_state" in heat_cooler["binary_sensors"]:
636636
self._cooling_active = heat_cooler["binary_sensors"]["cooling_state"]
637637

638-
self._write_json("all_data", {"entities": data.entities, "gateway": data.gateway})
638+
self._write_json("all_data", {"devices": data.devices, "gateway": data.gateway})
639639

640640
if "FIXTURES" in os.environ:
641641
_LOGGER.info("Skipping tests: Requested fixtures only") # pragma: no cover
642642
return # pragma: no cover
643643

644-
self.entity_list = list(data.entities.keys())
644+
self.entity_list = list(data.devices.keys())
645645
location_list = smile._loc_data
646646

647647
_LOGGER.info("Gateway id = %s", data.gateway["gateway_id"])
648648
_LOGGER.info("Hostname = %s", smile.smile_hostname)
649649
_LOGGER.info("Gateway data = %s", data.gateway)
650-
_LOGGER.info("Entities list = %s", data.entities)
651-
self.show_setup(location_list, data.entities)
650+
_LOGGER.info("Entities list = %s", data.devices)
651+
self.show_setup(location_list, data.devices)
652652

653653
if skip_testing:
654654
return
655655

656656
# Perform tests and asserts in two steps: devices and zones
657657
for header, data_dict in testdata.items():
658-
test_and_assert(data_dict, data.entities, header)
658+
test_and_assert(data_dict, data.devices, header)
659659

660660
# pragma warning restore S3776
661661

0 commit comments

Comments
 (0)