Skip to content

Commit c06822a

Browse files
authored
Merge pull request #199 from plugwise/support_aqara_plug
Add support for Aqara Plug
2 parents ee3d041 + a112ec6 commit c06822a

File tree

6 files changed

+112
-4
lines changed

6 files changed

+112
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Changelog
22

3+
# v0.20.0: Adam: add support for the Aqara Plug
4+
35
# v0.19.1: Smile & Stretch: line up error handling with Plugwise-beta
46

57
# v0.19.0: Smile Adam & Anna: cooling-related updates

plugwise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Plugwise module."""
22

3-
__version__ = "0.19.1"
3+
__version__ = "0.20.0"
44

55
from plugwise.smile import Smile
66
from plugwise.stick import Stick

plugwise/helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,16 +449,16 @@ def _energy_device_info_finder(self, appliance: etree, appl: Munch) -> Munch | N
449449
return appl
450450

451451
if self.smile_name == "Adam":
452-
locator = "./logs/point_log/electricity_point_meter"
453-
mod_type = "electricity_point_meter"
452+
locator = "./logs/interval_log/electricity_interval_meter"
453+
mod_type = "electricity_interval_meter"
454454
module_data = self._get_module_data(appliance, locator, mod_type)
455455
# Filter appliance without zigbee_mac, it's an orphaned device
456456
appl.zigbee_mac = module_data["zigbee_mac_address"]
457457
if appl.zigbee_mac is None:
458458
return None
459459

460460
appl.vendor_name = module_data["vendor_name"]
461-
appl.model = version_to_model(module_data["vendor_model"])
461+
appl.model = check_model(module_data["vendor_model"], appl.vendor_name)
462462
appl.hardware = module_data["hardware_version"]
463463
appl.firmware = module_data["firmware_version"]
464464

tests/test_smile.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,16 @@ async def test_connect_adam_plus_anna_copy_with_error_domain_added(self):
14971497
async def test_connect_adam_plus_anna_new(self):
14981498
"""Test extended Adam (firmware 3.6) with Anna and a switch-group setup."""
14991499
testdata = {
1500+
"67d73d0bd469422db25a618a5fb8eeb0": {
1501+
"dev_class": "zz_misc",
1502+
"location": "b4f211175e124df59603412bafa77a34",
1503+
"model": "lumi.plug.maeu01",
1504+
"name": "SmartPlug Floor 0",
1505+
"zigbee_mac_address": "54EF4410002C97F2",
1506+
"vendor": "LUMI",
1507+
"sensors": {"electricity_consumed_interval": 0.0},
1508+
"switches": {"relay": True, "lock": False},
1509+
},
15001510
"ad4838d7d35c4d6ea796ee12ae5aedf8": {
15011511
"dev_class": "thermostat",
15021512
"location": "f2bf9048bef64cc5b6d5110154e33c81",

userdata/adam_plus_anna_new/core.appliances.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<appliances>
3+
<appliance id='67d73d0bd469422db25a618a5fb8eeb0'>
4+
<name>SmartPlug Floor 0</name>
5+
<description>A device that communicates through the ZigBee protocol.</description>
6+
<type>zz_misc</type>
7+
<created_date>2022-03-11T11:21:58.858+01:00</created_date>
8+
<modified_date>2022-06-13T15:15:12.921+02:00</modified_date>
9+
<deleted_date></deleted_date>
10+
<location id='b4f211175e124df59603412bafa77a34'/>
11+
<groups/>
12+
<logs>
13+
<interval_log id='3c32af0fb9744d8baf9f68ba7f9143f3'>
14+
<type>electricity_consumed</type>
15+
<unit>Wh</unit>
16+
<updated_date>2022-06-13T15:00:00+02:00</updated_date>
17+
<last_consecutive_log_date>2022-06-13T14:45:00+02:00</last_consecutive_log_date>
18+
<interval>PT15M</interval>
19+
<electricity_interval_meter id='0d52d0e144b443f185ff0103962ab6ad'/>
20+
<period start_date="2022-06-13T15:00:00+02:00" end_date="2022-06-13T15:00:00+02:00" interval="PT15M">
21+
<measurement log_date="2022-06-13T15:00:00+02:00">0.00</measurement>
22+
</period>
23+
</interval_log>
24+
<interval_log id='56a14efb191c4e35890939aa65bd42fe'>
25+
<type>electricity_produced</type>
26+
<unit>Wh</unit>
27+
<updated_date></updated_date>
28+
<last_consecutive_log_date></last_consecutive_log_date>
29+
<interval>PT15M</interval>
30+
<electricity_interval_meter id='0d52d0e144b443f185ff0103962ab6ad'/>
31+
</interval_log>
32+
<point_log id='c62e9097eb324f539f62cb22d275533f'>
33+
<type>relay</type>
34+
<unit></unit>
35+
<updated_date>2022-06-13T15:15:12.918+02:00</updated_date>
36+
<last_consecutive_log_date>2022-06-11T15:25:12.796+02:00</last_consecutive_log_date>
37+
<interval/>
38+
<relay id='36368e4365e248f2a3afc21d5afb1693'/>
39+
<period start_date="2022-06-13T15:15:12.918+02:00" end_date="2022-06-13T15:15:12.918+02:00">
40+
<measurement log_date="2022-06-13T15:15:12.918+02:00">on</measurement>
41+
</period>
42+
</point_log>
43+
</logs>
44+
<actuator_functionalities>
45+
<relay_functionality id='76c3a214120b42e790641aff891a5f82'>
46+
<updated_date>2022-06-13T15:15:12.918+02:00</updated_date>
47+
<lock>false</lock>
48+
<state>on</state>
49+
<relay id='36368e4365e248f2a3afc21d5afb1693'/>
50+
</relay_functionality>
51+
</actuator_functionalities>
52+
</appliance>
353
<appliance id='ad4838d7d35c4d6ea796ee12ae5aedf8'>
454
<name>Anna</name>
555
<description>A Thermostat</description>

userdata/adam_plus_anna_new/core.modules.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<modules>
3+
<module id='6fe74ec044bd44d88ac0412df67f188f'>
4+
<vendor_name>LUMI</vendor_name>
5+
<vendor_model>lumi.plug.maeu01</vendor_model>
6+
<hardware_version></hardware_version>
7+
<firmware_version></firmware_version>
8+
<upgrade/>
9+
<created_date>2022-03-11T11:21:37.406+01:00</created_date>
10+
<modified_date>2022-03-11T18:44:23.929+01:00</modified_date>
11+
<deleted_date></deleted_date>
12+
<services>
13+
<electricity_interval_meter id='0d52d0e144b443f185ff0103962ab6ad' log_type='electricity' endpoint='1'>
14+
<functionalities><interval_log id='3c32af0fb9744d8baf9f68ba7f9143f3'/><interval_log id='56a14efb191c4e35890939aa65bd42fe'/></functionalities>
15+
</electricity_interval_meter>
16+
<relay id='36368e4365e248f2a3afc21d5afb1693' log_type='relay' endpoint='1'>
17+
<functionalities><relay_functionality id='76c3a214120b42e790641aff891a5f82'/><point_log id='c62e9097eb324f539f62cb22d275533f'/></functionalities>
18+
</relay>
19+
</services>
20+
<protocols>
21+
<zig_bee_node id='8e0dc5319eb0424eb6dc63943e9d0d3a'>
22+
<mac_address>54EF4410002C97F2</mac_address>
23+
<type>router</type>
24+
<reachable>true</reachable>
25+
<power_source>mains</power_source>
26+
<zig_bee_coordinator id='accec35dd04241ecb4ff68d2c35f2e36'/>
27+
<neighbors>
28+
<neighbor mac_address='000D6F0017DAA2B7'>
29+
<lqi>63</lqi>
30+
<depth>1</depth>
31+
<relationship>sibling</relationship>
32+
</neighbor>
33+
<neighbor mac_address='000D6F000C85F701'>
34+
<lqi>75</lqi>
35+
<depth>1</depth>
36+
<relationship>sibling</relationship>
37+
</neighbor>
38+
<neighbor mac_address='000D6F000D5A29BD'>
39+
<lqi>67</lqi>
40+
<depth>0</depth>
41+
<relationship>parent</relationship>
42+
</neighbor>
43+
</neighbors>
44+
<last_neighbor_table_received>2022-06-13T15:11:23+02:00</last_neighbor_table_received>
45+
<neighbor_table_support>true</neighbor_table_support>
46+
</zig_bee_node>
47+
</protocols>
48+
</module>
349
<module id='c50c2a4470f24206bd745ead65783c46'>
450
<vendor_name>Plugwise</vendor_name>
551
<vendor_model>Adam</vendor_model>

0 commit comments

Comments
 (0)