Skip to content

Commit 95c304e

Browse files
committed
Revert "Clean up testcase"
This reverts commit ea9cab1.
1 parent 648b405 commit 95c304e

File tree

1 file changed

+52
-5
lines changed

1 file changed

+52
-5
lines changed

tests/test_smile.py

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5056,13 +5056,60 @@ async def test_connect_p1v4(self):
50565056
@pytest.mark.asyncio
50575057
async def test_connect_p1v4_missing_logs(self):
50585058
"""Test a P1 firmware 4 setup."""
5059-
testdata = {}
5059+
testdata = {
5060+
"a455b61e52394b2db5081ce025a430f3": {
5061+
"dev_class": "gateway",
5062+
"firmware": "4.1.1",
5063+
"hardware": "AME Smile 2.0 board",
5064+
"location": "a455b61e52394b2db5081ce025a430f3",
5065+
"mac_address": "012345670001",
5066+
"model": "Gateway",
5067+
"name": "Smile P1",
5068+
"vendor": "Plugwise",
5069+
"binary_sensors": {"plugwise_notification": False},
5070+
},
5071+
"ba4de7613517478da82dd9b6abea36af": {
5072+
"dev_class": "smartmeter",
5073+
"location": "a455b61e52394b2db5081ce025a430f3",
5074+
"model": "KFM5KAIFA-METER",
5075+
"name": "P1",
5076+
"vendor": "SHENZHEN KAIFA TECHNOLOGY CHENGDU CO.",
5077+
"available": False,
5078+
"sensors": {
5079+
"net_electricity_point": 548,
5080+
"electricity_consumed_peak_point": 548,
5081+
"electricity_consumed_off_peak_point": 0,
5082+
"net_electricity_cumulative": 20983.453,
5083+
"electricity_consumed_peak_cumulative": 9067.554,
5084+
"electricity_consumed_off_peak_cumulative": 11915.899,
5085+
"electricity_consumed_peak_interval": 335,
5086+
"electricity_consumed_off_peak_interval": 0,
5087+
"electricity_produced_peak_point": 0,
5088+
"electricity_produced_off_peak_point": 0,
5089+
"electricity_produced_off_peak_cumulative": 0.0,
5090+
"electricity_produced_peak_cumulative": 0.0,
5091+
"electricity_produced_peak_interval": 0,
5092+
"electricity_produced_off_peak_interval": 0,
5093+
},
5094+
},
5095+
}
5096+
50605097
self.smile_setup = "p1v4_missing_logs"
50615098
server, smile, client = await self.connect_wrapper()
5062-
try:
5063-
await self.device_test(smile, testdata)
5064-
except pw_exceptions.XMLDataMissingError:
5065-
_LOGGER.error("XML data missing, processing stopped")
5099+
assert smile.smile_hostname == "smile000000"
5100+
5101+
_LOGGER.info("Basics:")
5102+
_LOGGER.info(" # Assert type = power")
5103+
assert smile.smile_type == "power"
5104+
_LOGGER.info(" # Assert version")
5105+
assert smile.smile_version[0] == "4.1.1"
5106+
_LOGGER.info(" # Assert legacy")
5107+
assert not smile._smile_legacy
5108+
5109+
await self.device_test(smile, testdata)
5110+
assert smile.gateway_id == "a455b61e52394b2db5081ce025a430f3"
5111+
assert self.device_items == 29
5112+
assert "97a04c0c263049b29350a660b4cdd01e" in self.notifications
50665113

50675114
await smile.close_connection()
50685115
await self.disconnect(server, client)

0 commit comments

Comments
 (0)