@@ -5052,6 +5052,67 @@ async def test_connect_p1v4(self):
50525052 await smile .close_connection ()
50535053 await self .disconnect (server , client )
50545054
5055+ @pytest .mark .asyncio
5056+ async def test_connect_p1v4_missing_logs (self ):
5057+ """Test a P1 firmware 4 setup."""
5058+ testdata = {
5059+ "a455b61e52394b2db5081ce025a430f3" : {
5060+ "dev_class" : "gateway" ,
5061+ "firmware" : "4.1.1" ,
5062+ "hardware" : "AME Smile 2.0 board" ,
5063+ "location" : "a455b61e52394b2db5081ce025a430f3" ,
5064+ "mac_address" : "012345670001" ,
5065+ "model" : "Gateway" ,
5066+ "name" : "Smile P1" ,
5067+ "vendor" : "Plugwise" ,
5068+ "binary_sensors" : {"plugwise_notification" : False },
5069+ },
5070+ "ba4de7613517478da82dd9b6abea36af" : {
5071+ "dev_class" : "smartmeter" ,
5072+ "location" : "a455b61e52394b2db5081ce025a430f3" ,
5073+ "model" : "KFM5KAIFA-METER" ,
5074+ "name" : "P1" ,
5075+ "vendor" : "SHENZHEN KAIFA TECHNOLOGY CHENGDU CO." ,
5076+ "available" : False ,
5077+ "sensors" : {
5078+ "net_electricity_point" : 548 ,
5079+ "electricity_consumed_peak_point" : 548 ,
5080+ "electricity_consumed_off_peak_point" : 0 ,
5081+ "net_electricity_cumulative" : 20983.453 ,
5082+ "electricity_consumed_peak_cumulative" : 9067.554 ,
5083+ "electricity_consumed_off_peak_cumulative" : 11915.899 ,
5084+ "electricity_consumed_peak_interval" : 335 ,
5085+ "electricity_consumed_off_peak_interval" : 0 ,
5086+ "electricity_produced_peak_point" : 0 ,
5087+ "electricity_produced_off_peak_point" : 0 ,
5088+ "electricity_produced_off_peak_cumulative" : 0.0 ,
5089+ "electricity_produced_peak_cumulative" : 0.0 ,
5090+ "electricity_produced_peak_interval" : 0 ,
5091+ "electricity_produced_off_peak_interval" : 0 ,
5092+ },
5093+ },
5094+ }
5095+
5096+ self .smile_setup = "p1v4_missing_logs"
5097+ server , smile , client = await self .connect_wrapper ()
5098+ assert smile .smile_hostname == "smile000000"
5099+
5100+ _LOGGER .info ("Basics:" )
5101+ _LOGGER .info (" # Assert type = power" )
5102+ assert smile .smile_type == "power"
5103+ _LOGGER .info (" # Assert version" )
5104+ assert smile .smile_version [0 ] == "4.1.1"
5105+ _LOGGER .info (" # Assert legacy" )
5106+ assert not smile ._smile_legacy
5107+
5108+ await self .device_test (smile , testdata )
5109+ assert smile .gateway_id == "a455b61e52394b2db5081ce025a430f3"
5110+ assert self .device_items == 29
5111+ assert "97a04c0c263049b29350a660b4cdd01e" in self .notifications
5112+
5113+ await smile .close_connection ()
5114+ await self .disconnect (server , client )
5115+
50555116 @pytest .mark .asyncio
50565117 async def test_fail_legacy_system (self ):
50575118 """Test erroneous legacy stretch system."""
0 commit comments