@@ -909,8 +909,7 @@ async def fake_get_missing_energy_logs(address: int) -> None:
909909
910910 # Test energy state without request
911911 assert stick .nodes ["0098765432101234" ].energy == pw_api .EnergyStatistics (
912- log_interval_consumption = None ,
913- log_interval_production = None ,
912+ log_interval = None ,
914913 hour_consumption = None ,
915914 hour_consumption_reset = None ,
916915 day_consumption = None ,
@@ -930,8 +929,7 @@ async def fake_get_missing_energy_logs(address: int) -> None:
930929 # Allow for background task to finish
931930
932931 assert stick .nodes ["0098765432101234" ].energy == pw_api .EnergyStatistics (
933- log_interval_consumption = 60 ,
934- log_interval_production = None ,
932+ log_interval = 60 ,
935933 hour_consumption = 0.0026868922443345974 ,
936934 hour_consumption_reset = utc_now .replace (minute = 0 , second = 0 , microsecond = 0 ),
937935 day_consumption = None ,
@@ -966,8 +964,7 @@ def test_pulse_collection_consumption(
966964 # No missing addresses yet
967965 test_timestamp = fixed_this_hour
968966 tst_consumption .add_log (100 , 1 , test_timestamp , 1000 )
969- assert tst_consumption .log_interval_consumption is None
970- assert tst_consumption .log_interval_production is None
967+ assert tst_consumption .log_interval is None
971968 assert not tst_consumption .production_logging # is None
972969 assert tst_consumption .collected_pulses (
973970 test_timestamp , is_consumption = True
@@ -979,8 +976,7 @@ def test_pulse_collection_consumption(
979976 # return intermediate missing addresses
980977 test_timestamp = fixed_this_hour - td (hours = 17 )
981978 tst_consumption .add_log (95 , 4 , test_timestamp , 1000 )
982- assert tst_consumption .log_interval_consumption is None
983- assert tst_consumption .log_interval_production is None
979+ assert tst_consumption .log_interval is None
984980 assert not tst_consumption .production_logging # is None
985981 assert tst_consumption .collected_pulses (
986982 test_timestamp , is_consumption = True
@@ -992,8 +988,7 @@ def test_pulse_collection_consumption(
992988 # so 'production logging' should be marked as False now
993989 test_timestamp = fixed_this_hour - td (hours = 18 )
994990 tst_consumption .add_log (95 , 3 , test_timestamp , 1000 )
995- assert tst_consumption .log_interval_consumption is None
996- assert tst_consumption .log_interval_production is None
991+ assert tst_consumption .log_interval is None
997992 assert not tst_consumption .production_logging
998993 assert tst_consumption .collected_pulses (
999994 test_timestamp , is_consumption = True
@@ -1003,8 +998,7 @@ def test_pulse_collection_consumption(
1003998 # Test consumption - Log import #4, no change
1004999 test_timestamp = fixed_this_hour - td (hours = 19 )
10051000 tst_consumption .add_log (95 , 2 , test_timestamp , 1000 )
1006- assert tst_consumption .log_interval_consumption is None
1007- assert tst_consumption .log_interval_production is None
1001+ assert tst_consumption .log_interval is None
10081002 assert not tst_consumption .production_logging
10091003 assert tst_consumption .collected_pulses (
10101004 test_timestamp , is_consumption = True
@@ -1015,26 +1009,23 @@ def test_pulse_collection_consumption(
10151009 # Complete log import for address 95 so it must drop from missing list
10161010 test_timestamp = fixed_this_hour - td (hours = 20 )
10171011 tst_consumption .add_log (95 , 1 , test_timestamp , 1000 )
1018- assert tst_consumption .log_interval_consumption is None
1019- assert tst_consumption .log_interval_production is None
1012+ assert tst_consumption .log_interval is None
10201013 assert not tst_consumption .production_logging
10211014 assert tst_consumption .log_addresses_missing == [99 , 98 , 97 , 96 ]
10221015
10231016 # Test consumption - Log import #6
10241017 # Add before last log so interval of consumption must be determined
10251018 test_timestamp = fixed_this_hour - td (hours = 1 )
10261019 tst_consumption .add_log (99 , 4 , test_timestamp , 750 )
1027- assert tst_consumption .log_interval_consumption == 60
1028- assert tst_consumption .log_interval_production is None
1020+ assert tst_consumption .log_interval == 60
10291021 assert not tst_consumption .production_logging
10301022 assert tst_consumption .log_addresses_missing == [99 , 98 , 97 , 96 ]
10311023 assert tst_consumption .collected_pulses (
10321024 fixed_this_hour , is_consumption = True
10331025 ) == (None , None )
10341026
10351027 tst_consumption .add_log (99 , 3 , fixed_this_hour - td (hours = 2 ), 1111 )
1036- assert tst_consumption .log_interval_consumption == 60
1037- assert tst_consumption .log_interval_production is None
1028+ assert tst_consumption .log_interval == 60
10381029 assert not tst_consumption .production_logging
10391030 assert tst_consumption .log_addresses_missing == [99 , 98 , 97 , 96 ]
10401031 assert tst_consumption .collected_pulses (
@@ -1217,8 +1208,7 @@ def test_pulse_collection_production(self, monkeypatch: pytest.MonkeyPatch) -> N
12171208 test_timestamp = fixed_this_hour - td (hours = 1 )
12181209 tst_production .add_log (200 , 1 , test_timestamp , 1000 )
12191210 assert tst_production .log_addresses_missing is None
1220- assert tst_production .log_interval_consumption is None
1221- assert tst_production .log_interval_production is None
1211+ assert tst_production .log_interval is None
12221212 # assert tst_production.production_logging
12231213
12241214 # Test consumption & production - Log import #3 - production
@@ -1227,17 +1217,15 @@ def test_pulse_collection_production(self, monkeypatch: pytest.MonkeyPatch) -> N
12271217 tst_production .add_log (199 , 4 , test_timestamp , 4000 )
12281218 missing_check = list (range (199 , 157 , - 1 ))
12291219 assert tst_production .log_addresses_missing == missing_check
1230- # assert tst_production.log_interval_consumption is None
1231- # assert tst_production.log_interval_production == 60
1220+ # assert tst_production.log_interval is None / == 60
12321221 # assert tst_production.production_logging
12331222
12341223 # Test consumption & production - Log import #4
12351224 # Interval of consumption is available
12361225 test_timestamp = fixed_this_hour - td (hours = 2 )
12371226 tst_production .add_log (199 , 3 , test_timestamp , 3000 )
12381227 assert tst_production .log_addresses_missing == missing_check
1239- # assert tst_production.log_interval_consumption == 60
1240- # assert tst_production.log_interval_production == 60
1228+ # assert tst_production.log_interval == 60
12411229 # assert tst_production.production_logging
12421230
12431231 pulse_update_1 = fixed_this_hour + td (minutes = 5 )
0 commit comments