From 692b642bfd0fd495836bdd583b969d782ef5b5b1 Mon Sep 17 00:00:00 2001 From: Hoffmann77 <36714809+Hoffmann77@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:27:44 +0200 Subject: [PATCH] test: add new tests --- .github/workflows/tests.yml | 1 + .../gateway_reader/descriptors.py | 31 ++++ .../gateway_reader/endpoint.py | 16 +- .../enphase_gateway/gateway_reader/gateway.py | 79 +++++---- .../gateway_reader/gateway_reader.py | 5 +- custom_components/enphase_gateway/sensor.py | 2 +- tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/info | 0 .../{3.7.0 => 3.7.0_envoy_r}/info_log.json | 0 .../ivp_ensemble_dry_contacts | 0 .../ivp_ensemble_dry_contacts_log.json | 0 .../ivp_ensemble_inventory | 0 .../ivp_ensemble_inventory_log.json | 0 .../ivp_ss_dry_contact_settings | 0 .../ivp_ss_dry_contact_settings_log.json | 0 .../{3.7.0 => 3.7.0_envoy_r}/production | 0 .../{3.7.0 => 3.7.0_envoy_r}/production.json | 0 .../production.json_log.json | 0 .../production_log.json | 0 .../api_v1_production | 0 .../api_v1_production_inverters | 0 .../api_v1_production_inverters_log.json | 0 .../api_v1_production_log.json | 0 .../fixtures/{3.9.36 => 3.9.36_envoy_r}/info | 0 .../{3.9.36 => 3.9.36_envoy_r}/info_log.json | 0 .../ivp_ensemble_dry_contacts | 0 .../ivp_ensemble_dry_contacts_log.json | 0 .../ivp_ensemble_inventory | 0 .../ivp_ensemble_inventory_log.json | 0 .../ivp_ensemble_power | 0 .../ivp_ensemble_power_log.json | 0 .../ivp_ss_dry_contact_settings | 0 .../ivp_ss_dry_contact_settings_log.json | 0 .../{3.9.36 => 3.9.36_envoy_r}/production | 0 .../production.json | 0 .../production.json_log.json | 0 .../production_log.json | 0 .../admin_lib_tariff | 0 .../admin_lib_tariff_log.json | 0 .../api_v1_production | 0 .../api_v1_production_inverters | 0 .../api_v1_production_inverters_log.json | 0 .../api_v1_production_log.json | 0 .../info | 0 .../info_log.json | 0 .../ivp_ensemble_dry_contacts | 0 .../ivp_ensemble_dry_contacts_log.json | 0 .../ivp_ensemble_generator | 0 .../ivp_ensemble_generator_log.json | 0 .../ivp_ensemble_inventory | 0 .../ivp_ensemble_inventory_log.json | 0 .../ivp_ensemble_secctrl | 0 .../ivp_ensemble_secctrl_log.json | 0 .../ivp_ensemble_status | 0 .../ivp_ensemble_status_log.json | 0 .../ivp_meters | 0 .../ivp_meters_log.json | 0 .../ivp_meters_readings | 0 .../ivp_meters_readings_log.json | 0 .../ivp_sc_pvlimit | 0 .../ivp_sc_pvlimit_log.json | 0 .../ivp_ss_dry_contact_settings | 0 .../ivp_ss_dry_contact_settings_log.json | 0 .../ivp_ss_gen_config | 0 .../ivp_ss_gen_config_log.json | 0 .../ivp_ss_gen_schedule | 0 .../ivp_ss_gen_schedule_log.json | 0 .../ivp_ss_pel_settings | 0 .../ivp_ss_pel_settings_log.json | 0 .../production | 0 .../production.json | 0 .../production.json_log.json | 0 .../production_log.json | 0 .../admin_lib_tariff | 0 .../admin_lib_tariff_log.json | 0 .../api_v1_production | 0 .../api_v1_production_inverters | 0 .../api_v1_production_inverters_log.json | 0 .../api_v1_production_log.json | 0 .../info | 0 .../info_log.json | 0 .../ivp_ensemble_dry_contacts | 0 .../ivp_ensemble_dry_contacts_log.json | 0 .../ivp_ensemble_generator | 0 .../ivp_ensemble_generator_log.json | 0 .../ivp_ensemble_inventory | 0 .../ivp_ensemble_inventory_log.json | 0 .../ivp_ensemble_power | 0 .../ivp_ensemble_power_log.json | 0 .../ivp_ensemble_secctrl | 0 .../ivp_ensemble_secctrl_log.json | 0 .../ivp_ensemble_status | 0 .../ivp_ensemble_status_log.json | 0 .../ivp_meters | 0 .../ivp_meters_log.json | 1 - .../ivp_meters_readings | 0 .../ivp_meters_readings_log.json | 12 ++ .../ivp_sc_pvlimit | 0 .../ivp_sc_pvlimit_log.json | 0 .../ivp_ss_dry_contact_settings | 0 .../ivp_ss_dry_contact_settings_log.json | 0 .../ivp_ss_gen_config | 0 .../ivp_ss_gen_config_log.json | 0 .../ivp_ss_gen_schedule | 0 .../ivp_ss_gen_schedule_log.json | 0 .../ivp_ss_pel_settings | 0 .../ivp_ss_pel_settings_log.json | 0 .../production | 0 .../production.json | 0 .../production.json_log.json | 16 ++ .../production_log.json | 0 .../admin_lib_tariff | 1 + .../admin_lib_tariff_log.json | 1 + .../api_v1_production | 6 + .../api_v1_production_inverters | 100 +++++++++++ .../api_v1_production_inverters_log.json | 1 + .../api_v1_production_log.json | 1 + .../7.6.175_envoy_s_metered_cts_disabled/info | 75 ++++++++ .../info_log.json | 1 + .../ivp_ensemble_dry_contacts | 20 +++ .../ivp_ensemble_dry_contacts_log.json | 1 + .../ivp_ensemble_generator | 11 ++ .../ivp_ensemble_generator_log.json | 1 + .../ivp_ensemble_inventory | 1 + .../ivp_ensemble_inventory_log.json | 1 + .../ivp_ensemble_power | 3 + .../ivp_ensemble_power_log.json | 1 + .../ivp_ensemble_secctrl | 27 +++ .../ivp_ensemble_secctrl_log.json | 1 + .../ivp_ensemble_status | 77 ++++++++ .../ivp_ensemble_status_log.json | 1 + .../ivp_meters | 20 +++ .../ivp_meters_log.json | 1 + .../ivp_meters_readings | 142 +++++++++++++++ .../ivp_meters_readings_log.json | 2 +- .../ivp_sc_pvlimit | 4 + .../ivp_sc_pvlimit_log.json | 1 + .../ivp_ss_dry_contact_settings | 56 ++++++ .../ivp_ss_dry_contact_settings_log.json | 1 + .../ivp_ss_gen_config | 1 + .../ivp_ss_gen_config_log.json | 1 + .../ivp_ss_gen_schedule | 1 + .../ivp_ss_gen_schedule_log.json | 1 + .../ivp_ss_pel_settings | 3 + .../ivp_ss_pel_settings_log.json | 1 + .../production | 1 + .../production.json | 1 + .../production.json_log.json | 2 +- .../production_log.json | 1 + tests/test_endpoints.py | 164 ++++++++++++------ 149 files changed, 803 insertions(+), 95 deletions(-) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/info (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/info_log.json (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/ivp_ensemble_dry_contacts (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/ivp_ensemble_dry_contacts_log.json (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/ivp_ensemble_inventory (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/ivp_ensemble_inventory_log.json (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/ivp_ss_dry_contact_settings (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/ivp_ss_dry_contact_settings_log.json (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/production (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/production.json (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/production.json_log.json (100%) rename tests/fixtures/{3.7.0 => 3.7.0_envoy_r}/production_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/api_v1_production (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/api_v1_production_inverters (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/api_v1_production_inverters_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/api_v1_production_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/info (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/info_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ensemble_dry_contacts (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ensemble_dry_contacts_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ensemble_inventory (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ensemble_inventory_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ensemble_power (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ensemble_power_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ss_dry_contact_settings (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/ivp_ss_dry_contact_settings_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/production (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/production.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/production.json_log.json (100%) rename tests/fixtures/{3.9.36 => 3.9.36_envoy_r}/production_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/admin_lib_tariff (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/admin_lib_tariff_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/api_v1_production (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/api_v1_production_inverters (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/api_v1_production_inverters_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/api_v1_production_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/info (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/info_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_dry_contacts (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_dry_contacts_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_generator (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_generator_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_inventory (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_inventory_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_secctrl (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_secctrl_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_status (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ensemble_status_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_meters (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_meters_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_meters_readings (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_meters_readings_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_sc_pvlimit (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_sc_pvlimit_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_dry_contact_settings (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_dry_contact_settings_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_gen_config (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_gen_config_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_gen_schedule (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_gen_schedule_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_pel_settings (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/ivp_ss_pel_settings_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/production (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/production.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/production.json_log.json (100%) rename tests/fixtures/{3.9.36_bad_auth => 3.9.36_envoy_r_bad_auth}/production_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/admin_lib_tariff (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/admin_lib_tariff_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/api_v1_production (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/api_v1_production_inverters (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/api_v1_production_inverters_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/api_v1_production_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/info (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/info_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_dry_contacts (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_dry_contacts_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_generator (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_generator_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_inventory (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_inventory_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_power (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_power_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_secctrl (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_secctrl_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_status (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ensemble_status_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_meters (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_meters_log.json (89%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_meters_readings (100%) create mode 100644 tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_readings_log.json rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_sc_pvlimit (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_sc_pvlimit_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_dry_contact_settings (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_dry_contact_settings_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_gen_config (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_gen_config_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_gen_schedule (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_gen_schedule_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_pel_settings (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/ivp_ss_pel_settings_log.json (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/production (100%) rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/production.json (100%) create mode 100644 tests/fixtures/7.6.175_envoy_s_metered/production.json_log.json rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered}/production_log.json (100%) create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_readings rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered_cts_disabled}/ivp_meters_readings_log.json (55%) create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings_log.json create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production.json rename tests/fixtures/{7.6.175_EnvoySMetered => 7.6.175_envoy_s_metered_cts_disabled}/production.json_log.json (67%) create mode 100644 tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production_log.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1902cce..2b55e57 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,3 +36,4 @@ jobs: - name: Test with pytest run: | pytest + # pytest --log-cli-level=DEBUG diff --git a/custom_components/enphase_gateway/gateway_reader/descriptors.py b/custom_components/enphase_gateway/gateway_reader/descriptors.py index 3318ae4..7254644 100644 --- a/custom_components/enphase_gateway/gateway_reader/descriptors.py +++ b/custom_components/enphase_gateway/gateway_reader/descriptors.py @@ -32,6 +32,37 @@ def __set_name__(self, owner, name) -> None: setattr(owner, uid, {name: _endpoint}) +class PropertyDescriptor(BaseDescriptor): + """Property descriptor. + + A pure python implementation of property that registers the + required endpoint and the caching interval. + """ + + def __init__( + self, + fget=None, + doc=None, + required_endpoint: str | None = None, + cache: int = 0, + ) -> None: + """Initialize instance of PropertyDescriptor.""" + super().__init__(required_endpoint, cache) + self.fget = fget + if doc is None and fget is not None: + doc = fget.__doc__ + self.__doc__ = doc + self._name = "" + + def __get__(self, obj, objtype=None): + """Magic method. Return the response of the fget function.""" + if obj is None: + return self + if self.fget is None: + raise AttributeError(f"property '{self._name}' has no getter") + return self.fget(obj) + + class ResponseDescriptor(BaseDescriptor): """Descriptor returning the raw response.""" diff --git a/custom_components/enphase_gateway/gateway_reader/endpoint.py b/custom_components/enphase_gateway/gateway_reader/endpoint.py index d9fcba1..108fbfd 100644 --- a/custom_components/enphase_gateway/gateway_reader/endpoint.py +++ b/custom_components/enphase_gateway/gateway_reader/endpoint.py @@ -6,10 +6,16 @@ class GatewayEndpoint: """Class representing a Gateway endpoint.""" - def __init__(self, endpoint_path: str, cache: int = 0) -> None: + def __init__( + self, + endpoint_path: str, + cache: int = 0, + fetch: bool = True + ) -> None: """Initialize instance of GatewayEndpoint.""" self.path = endpoint_path self.cache = cache + self.fetch = fetch self._last_fetch = None self._base_url = "{}://{}/{}" @@ -20,12 +26,14 @@ def __repr__(self): @property def update_required(self) -> bool: """Check if an update is required for this endpoint.""" - if not self._last_fetch: + if self.fetch is False: + return False + elif not self._last_fetch: return True elif (self._last_fetch + self.cache) <= time.time(): return True - else: - return False + + return False def get_url(self, protocol, host): """Return formatted url.""" diff --git a/custom_components/enphase_gateway/gateway_reader/gateway.py b/custom_components/enphase_gateway/gateway_reader/gateway.py index 57092b9..9e9e55d 100644 --- a/custom_components/enphase_gateway/gateway_reader/gateway.py +++ b/custom_components/enphase_gateway/gateway_reader/gateway.py @@ -10,38 +10,50 @@ from .const import AVAILABLE_PROPERTIES from .endpoint import GatewayEndpoint -from .descriptors import ResponseDescriptor, JsonDescriptor, RegexDescriptor +from .descriptors import ( + PropertyDescriptor, + ResponseDescriptor, + JsonDescriptor, + RegexDescriptor, +) _LOGGER = logging.getLogger(__name__) -def gateway_property(_func: Callable | None = None, **kwargs) -> None: - """Register an instance's method as a property of a gateway. +def gateway_property( + _func: Callable | None = None, + **kwargs: dict, +) -> PropertyDescriptor: + """Decorate the given method as gateway property. + + Works identical to the python property decorator. + Additionally registers the method to the '_gateway_properties' dict + of the methods parent class. Parameters ---------- _func : Callable, optional - Decorated method. The default is None. - **kwargs + Method to decorate. The default is None. + **kwargs : dict Optional keyword arguments. Returns ------- - method - Decorated method. + PropertyDescriptor + Property descriptor calling the method on attribute access. """ required_endpoint = kwargs.pop("required_endpoint", None) cache = kwargs.pop("cache", 0) def decorator(func): - endpoint = None - if required_endpoint: - endpoint = GatewayEndpoint(required_endpoint, cache) - - func.gateway_property = endpoint # flag method as gateway property - return func + return PropertyDescriptor( + fget=func, + doc=None, + required_endpoint=required_endpoint, + cache=cache, + ) return decorator if _func is None else decorator(_func) @@ -120,15 +132,7 @@ def __new__(cls, *args, **kwargs): # catch flagged methods and add to instance's # _gateway_properties or _gateway_probes. - if endpoint := getattr(attr_val, "gateway_property", None): - if attr_name not in gateway_properties.keys(): - gateway_properties[attr_name] = endpoint - setattr( - instance.__class__, - attr_name, - property(attr_val), - ) - elif endpoint := getattr(attr_val, "gateway_probe", None): + if endpoint := getattr(attr_val, "gateway_probe", None): gateway_probes.setdefault(attr_name, endpoint) instance._gateway_properties = gateway_properties @@ -185,12 +189,15 @@ def update_endpoints(endpoint): for prop, prop_endpoint in self._gateway_properties.items(): if isinstance(prop_endpoint, GatewayEndpoint): - value = getattr(self, prop) - if self.initial_update_finished and value in (None, [], {}): + if self.initial_update_finished: # When the value is None or empty list or dict, # then the endpoint is useless for this token, - # so do not require it. - continue + # so we do not require it. + if (val := getattr(self, prop)) in (None, [], {}): + _LOGGER.debug( + f"Skip property: {prop} : {prop_endpoint} : {val}" + ) + continue update_endpoints(prop_endpoint) @@ -233,6 +240,9 @@ def set_endpoint_data( return content_type = response.headers.get("content-type", "application/json") + _LOGGER.debug( + f"Setting endpoint data: {endpoint} : {response.content}" + ) if content_type == "application/json": self.data[endpoint.path] = response.json() elif content_type in ("text/xml", "application/xml"): @@ -381,12 +391,23 @@ def encharge_power(self): return None - # @gateway_property - # def ac_battery(self) -> ACBattery | None: + # @gateway_property(required_endpoint="ivp/ensemble/secctrl") + # def ensemble_secctrl(self): + # """Ensemble secctrl data.""" + # data = self.data.get("ivp/ensemble/secctrl", {}) + # result = JsonDescriptor.resolve("", data) + # if self.initial_update_finished is False: + # if self.encharge_inventory is None: + # return None + + # return result if result else None + + # @gateway_property(required_endpoint="production.json") + # def ac_battery(self): # """AC battery data.""" # data = self.data.get("production.json", {}) # result = JsonDescriptor.resolve("storage[?(@.percentFull)]", data) - # return ACBattery(result) if result else None + # return result if result else None # @gateway_property(required_endpoint="ensemble_submod") # def ensemble_submod(self): diff --git a/custom_components/enphase_gateway/gateway_reader/gateway_reader.py b/custom_components/enphase_gateway/gateway_reader/gateway_reader.py index 2d189bb..071ffee 100644 --- a/custom_components/enphase_gateway/gateway_reader/gateway_reader.py +++ b/custom_components/enphase_gateway/gateway_reader/gateway_reader.py @@ -99,7 +99,9 @@ async def prepare(self): + f"imeter: {self._info.imeter}, " + f"web_tokens: {self._info.web_tokens}" ) - _LOGGER.debug(f"Initial Gateway class: {self.gateway.__class__}") + _LOGGER.debug( + f"Initial Gateway class: {self.gateway.__class__.__name__}" + ) async def update( self, @@ -227,7 +229,6 @@ async def _update_endpoint(self, endpoint: GatewayEndpoint) -> None: follow_redirects=False ) if self.gateway: - _LOGGER.debug(f"Setting endpoint data: {endpoint} : {response}") self.gateway.set_endpoint_data(endpoint, response) async def _async_get(self, url: str, handle_401: bool = True, **kwargs): diff --git a/custom_components/enphase_gateway/sensor.py b/custom_components/enphase_gateway/sensor.py index 6244a6c..c0b27c9 100644 --- a/custom_components/enphase_gateway/sensor.py +++ b/custom_components/enphase_gateway/sensor.py @@ -357,7 +357,7 @@ async def async_setup_entry( GatewaySensorEntity(coordinator, sensor_description) ) - if data := coordinator.data.inverters_production and conf_inverters: + if (data := coordinator.data.inverters_production) and conf_inverters: if conf_inverters == "gateway_sensor": entities.extend( GatewaySensorInverterEntity(coordinator, description, inverter) diff --git a/tests/fixtures/3.7.0/info b/tests/fixtures/3.7.0_envoy_r/info similarity index 100% rename from tests/fixtures/3.7.0/info rename to tests/fixtures/3.7.0_envoy_r/info diff --git a/tests/fixtures/3.7.0/info_log.json b/tests/fixtures/3.7.0_envoy_r/info_log.json similarity index 100% rename from tests/fixtures/3.7.0/info_log.json rename to tests/fixtures/3.7.0_envoy_r/info_log.json diff --git a/tests/fixtures/3.7.0/ivp_ensemble_dry_contacts b/tests/fixtures/3.7.0_envoy_r/ivp_ensemble_dry_contacts similarity index 100% rename from tests/fixtures/3.7.0/ivp_ensemble_dry_contacts rename to tests/fixtures/3.7.0_envoy_r/ivp_ensemble_dry_contacts diff --git a/tests/fixtures/3.7.0/ivp_ensemble_dry_contacts_log.json b/tests/fixtures/3.7.0_envoy_r/ivp_ensemble_dry_contacts_log.json similarity index 100% rename from tests/fixtures/3.7.0/ivp_ensemble_dry_contacts_log.json rename to tests/fixtures/3.7.0_envoy_r/ivp_ensemble_dry_contacts_log.json diff --git a/tests/fixtures/3.7.0/ivp_ensemble_inventory b/tests/fixtures/3.7.0_envoy_r/ivp_ensemble_inventory similarity index 100% rename from tests/fixtures/3.7.0/ivp_ensemble_inventory rename to tests/fixtures/3.7.0_envoy_r/ivp_ensemble_inventory diff --git a/tests/fixtures/3.7.0/ivp_ensemble_inventory_log.json b/tests/fixtures/3.7.0_envoy_r/ivp_ensemble_inventory_log.json similarity index 100% rename from tests/fixtures/3.7.0/ivp_ensemble_inventory_log.json rename to tests/fixtures/3.7.0_envoy_r/ivp_ensemble_inventory_log.json diff --git a/tests/fixtures/3.7.0/ivp_ss_dry_contact_settings b/tests/fixtures/3.7.0_envoy_r/ivp_ss_dry_contact_settings similarity index 100% rename from tests/fixtures/3.7.0/ivp_ss_dry_contact_settings rename to tests/fixtures/3.7.0_envoy_r/ivp_ss_dry_contact_settings diff --git a/tests/fixtures/3.7.0/ivp_ss_dry_contact_settings_log.json b/tests/fixtures/3.7.0_envoy_r/ivp_ss_dry_contact_settings_log.json similarity index 100% rename from tests/fixtures/3.7.0/ivp_ss_dry_contact_settings_log.json rename to tests/fixtures/3.7.0_envoy_r/ivp_ss_dry_contact_settings_log.json diff --git a/tests/fixtures/3.7.0/production b/tests/fixtures/3.7.0_envoy_r/production similarity index 100% rename from tests/fixtures/3.7.0/production rename to tests/fixtures/3.7.0_envoy_r/production diff --git a/tests/fixtures/3.7.0/production.json b/tests/fixtures/3.7.0_envoy_r/production.json similarity index 100% rename from tests/fixtures/3.7.0/production.json rename to tests/fixtures/3.7.0_envoy_r/production.json diff --git a/tests/fixtures/3.7.0/production.json_log.json b/tests/fixtures/3.7.0_envoy_r/production.json_log.json similarity index 100% rename from tests/fixtures/3.7.0/production.json_log.json rename to tests/fixtures/3.7.0_envoy_r/production.json_log.json diff --git a/tests/fixtures/3.7.0/production_log.json b/tests/fixtures/3.7.0_envoy_r/production_log.json similarity index 100% rename from tests/fixtures/3.7.0/production_log.json rename to tests/fixtures/3.7.0_envoy_r/production_log.json diff --git a/tests/fixtures/3.9.36/api_v1_production b/tests/fixtures/3.9.36_envoy_r/api_v1_production similarity index 100% rename from tests/fixtures/3.9.36/api_v1_production rename to tests/fixtures/3.9.36_envoy_r/api_v1_production diff --git a/tests/fixtures/3.9.36/api_v1_production_inverters b/tests/fixtures/3.9.36_envoy_r/api_v1_production_inverters similarity index 100% rename from tests/fixtures/3.9.36/api_v1_production_inverters rename to tests/fixtures/3.9.36_envoy_r/api_v1_production_inverters diff --git a/tests/fixtures/3.9.36/api_v1_production_inverters_log.json b/tests/fixtures/3.9.36_envoy_r/api_v1_production_inverters_log.json similarity index 100% rename from tests/fixtures/3.9.36/api_v1_production_inverters_log.json rename to tests/fixtures/3.9.36_envoy_r/api_v1_production_inverters_log.json diff --git a/tests/fixtures/3.9.36/api_v1_production_log.json b/tests/fixtures/3.9.36_envoy_r/api_v1_production_log.json similarity index 100% rename from tests/fixtures/3.9.36/api_v1_production_log.json rename to tests/fixtures/3.9.36_envoy_r/api_v1_production_log.json diff --git a/tests/fixtures/3.9.36/info b/tests/fixtures/3.9.36_envoy_r/info similarity index 100% rename from tests/fixtures/3.9.36/info rename to tests/fixtures/3.9.36_envoy_r/info diff --git a/tests/fixtures/3.9.36/info_log.json b/tests/fixtures/3.9.36_envoy_r/info_log.json similarity index 100% rename from tests/fixtures/3.9.36/info_log.json rename to tests/fixtures/3.9.36_envoy_r/info_log.json diff --git a/tests/fixtures/3.9.36/ivp_ensemble_dry_contacts b/tests/fixtures/3.9.36_envoy_r/ivp_ensemble_dry_contacts similarity index 100% rename from tests/fixtures/3.9.36/ivp_ensemble_dry_contacts rename to tests/fixtures/3.9.36_envoy_r/ivp_ensemble_dry_contacts diff --git a/tests/fixtures/3.9.36/ivp_ensemble_dry_contacts_log.json b/tests/fixtures/3.9.36_envoy_r/ivp_ensemble_dry_contacts_log.json similarity index 100% rename from tests/fixtures/3.9.36/ivp_ensemble_dry_contacts_log.json rename to tests/fixtures/3.9.36_envoy_r/ivp_ensemble_dry_contacts_log.json diff --git a/tests/fixtures/3.9.36/ivp_ensemble_inventory b/tests/fixtures/3.9.36_envoy_r/ivp_ensemble_inventory similarity index 100% rename from tests/fixtures/3.9.36/ivp_ensemble_inventory rename to tests/fixtures/3.9.36_envoy_r/ivp_ensemble_inventory diff --git a/tests/fixtures/3.9.36/ivp_ensemble_inventory_log.json b/tests/fixtures/3.9.36_envoy_r/ivp_ensemble_inventory_log.json similarity index 100% rename from tests/fixtures/3.9.36/ivp_ensemble_inventory_log.json rename to tests/fixtures/3.9.36_envoy_r/ivp_ensemble_inventory_log.json diff --git a/tests/fixtures/3.9.36/ivp_ensemble_power b/tests/fixtures/3.9.36_envoy_r/ivp_ensemble_power similarity index 100% rename from tests/fixtures/3.9.36/ivp_ensemble_power rename to tests/fixtures/3.9.36_envoy_r/ivp_ensemble_power diff --git a/tests/fixtures/3.9.36/ivp_ensemble_power_log.json b/tests/fixtures/3.9.36_envoy_r/ivp_ensemble_power_log.json similarity index 100% rename from tests/fixtures/3.9.36/ivp_ensemble_power_log.json rename to tests/fixtures/3.9.36_envoy_r/ivp_ensemble_power_log.json diff --git a/tests/fixtures/3.9.36/ivp_ss_dry_contact_settings b/tests/fixtures/3.9.36_envoy_r/ivp_ss_dry_contact_settings similarity index 100% rename from tests/fixtures/3.9.36/ivp_ss_dry_contact_settings rename to tests/fixtures/3.9.36_envoy_r/ivp_ss_dry_contact_settings diff --git a/tests/fixtures/3.9.36/ivp_ss_dry_contact_settings_log.json b/tests/fixtures/3.9.36_envoy_r/ivp_ss_dry_contact_settings_log.json similarity index 100% rename from tests/fixtures/3.9.36/ivp_ss_dry_contact_settings_log.json rename to tests/fixtures/3.9.36_envoy_r/ivp_ss_dry_contact_settings_log.json diff --git a/tests/fixtures/3.9.36/production b/tests/fixtures/3.9.36_envoy_r/production similarity index 100% rename from tests/fixtures/3.9.36/production rename to tests/fixtures/3.9.36_envoy_r/production diff --git a/tests/fixtures/3.9.36/production.json b/tests/fixtures/3.9.36_envoy_r/production.json similarity index 100% rename from tests/fixtures/3.9.36/production.json rename to tests/fixtures/3.9.36_envoy_r/production.json diff --git a/tests/fixtures/3.9.36/production.json_log.json b/tests/fixtures/3.9.36_envoy_r/production.json_log.json similarity index 100% rename from tests/fixtures/3.9.36/production.json_log.json rename to tests/fixtures/3.9.36_envoy_r/production.json_log.json diff --git a/tests/fixtures/3.9.36/production_log.json b/tests/fixtures/3.9.36_envoy_r/production_log.json similarity index 100% rename from tests/fixtures/3.9.36/production_log.json rename to tests/fixtures/3.9.36_envoy_r/production_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/admin_lib_tariff b/tests/fixtures/3.9.36_envoy_r_bad_auth/admin_lib_tariff similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/admin_lib_tariff rename to tests/fixtures/3.9.36_envoy_r_bad_auth/admin_lib_tariff diff --git a/tests/fixtures/3.9.36_bad_auth/admin_lib_tariff_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/admin_lib_tariff_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/admin_lib_tariff_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/admin_lib_tariff_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/api_v1_production b/tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/api_v1_production rename to tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production diff --git a/tests/fixtures/3.9.36_bad_auth/api_v1_production_inverters b/tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production_inverters similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/api_v1_production_inverters rename to tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production_inverters diff --git a/tests/fixtures/3.9.36_bad_auth/api_v1_production_inverters_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production_inverters_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/api_v1_production_inverters_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production_inverters_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/api_v1_production_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/api_v1_production_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/api_v1_production_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/info b/tests/fixtures/3.9.36_envoy_r_bad_auth/info similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/info rename to tests/fixtures/3.9.36_envoy_r_bad_auth/info diff --git a/tests/fixtures/3.9.36_bad_auth/info_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/info_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/info_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/info_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_dry_contacts b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_dry_contacts similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_dry_contacts rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_dry_contacts diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_dry_contacts_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_dry_contacts_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_dry_contacts_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_dry_contacts_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_generator b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_generator similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_generator rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_generator diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_generator_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_generator_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_generator_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_generator_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_inventory b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_inventory similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_inventory rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_inventory diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_inventory_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_inventory_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_inventory_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_inventory_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_secctrl b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_secctrl similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_secctrl rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_secctrl diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_secctrl_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_secctrl_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_secctrl_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_secctrl_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_status b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_status similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_status rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_status diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ensemble_status_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_status_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ensemble_status_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ensemble_status_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_meters b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_meters rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_meters_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_meters_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_meters_readings b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters_readings similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_meters_readings rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters_readings diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_meters_readings_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters_readings_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_meters_readings_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_meters_readings_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_sc_pvlimit b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_sc_pvlimit similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_sc_pvlimit rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_sc_pvlimit diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_sc_pvlimit_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_sc_pvlimit_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_sc_pvlimit_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_sc_pvlimit_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_dry_contact_settings b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_dry_contact_settings similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_dry_contact_settings rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_dry_contact_settings diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_dry_contact_settings_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_dry_contact_settings_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_dry_contact_settings_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_dry_contact_settings_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_config b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_config similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_config rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_config diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_config_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_config_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_config_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_config_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_schedule b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_schedule similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_schedule rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_schedule diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_schedule_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_schedule_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_gen_schedule_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_gen_schedule_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_pel_settings b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_pel_settings similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_pel_settings rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_pel_settings diff --git a/tests/fixtures/3.9.36_bad_auth/ivp_ss_pel_settings_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_pel_settings_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/ivp_ss_pel_settings_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/ivp_ss_pel_settings_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/production b/tests/fixtures/3.9.36_envoy_r_bad_auth/production similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/production rename to tests/fixtures/3.9.36_envoy_r_bad_auth/production diff --git a/tests/fixtures/3.9.36_bad_auth/production.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/production.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/production.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/production.json diff --git a/tests/fixtures/3.9.36_bad_auth/production.json_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/production.json_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/production.json_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/production.json_log.json diff --git a/tests/fixtures/3.9.36_bad_auth/production_log.json b/tests/fixtures/3.9.36_envoy_r_bad_auth/production_log.json similarity index 100% rename from tests/fixtures/3.9.36_bad_auth/production_log.json rename to tests/fixtures/3.9.36_envoy_r_bad_auth/production_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/admin_lib_tariff b/tests/fixtures/7.6.175_envoy_s_metered/admin_lib_tariff similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/admin_lib_tariff rename to tests/fixtures/7.6.175_envoy_s_metered/admin_lib_tariff diff --git a/tests/fixtures/7.6.175_EnvoySMetered/admin_lib_tariff_log.json b/tests/fixtures/7.6.175_envoy_s_metered/admin_lib_tariff_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/admin_lib_tariff_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/admin_lib_tariff_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/api_v1_production b/tests/fixtures/7.6.175_envoy_s_metered/api_v1_production similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/api_v1_production rename to tests/fixtures/7.6.175_envoy_s_metered/api_v1_production diff --git a/tests/fixtures/7.6.175_EnvoySMetered/api_v1_production_inverters b/tests/fixtures/7.6.175_envoy_s_metered/api_v1_production_inverters similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/api_v1_production_inverters rename to tests/fixtures/7.6.175_envoy_s_metered/api_v1_production_inverters diff --git a/tests/fixtures/7.6.175_EnvoySMetered/api_v1_production_inverters_log.json b/tests/fixtures/7.6.175_envoy_s_metered/api_v1_production_inverters_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/api_v1_production_inverters_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/api_v1_production_inverters_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/api_v1_production_log.json b/tests/fixtures/7.6.175_envoy_s_metered/api_v1_production_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/api_v1_production_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/api_v1_production_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/info b/tests/fixtures/7.6.175_envoy_s_metered/info similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/info rename to tests/fixtures/7.6.175_envoy_s_metered/info diff --git a/tests/fixtures/7.6.175_EnvoySMetered/info_log.json b/tests/fixtures/7.6.175_envoy_s_metered/info_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/info_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/info_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_dry_contacts b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_dry_contacts similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_dry_contacts rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_dry_contacts diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_dry_contacts_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_dry_contacts_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_dry_contacts_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_dry_contacts_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_generator b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_generator similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_generator rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_generator diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_generator_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_generator_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_generator_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_generator_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_inventory b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_inventory similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_inventory rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_inventory diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_inventory_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_inventory_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_inventory_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_inventory_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_power b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_power similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_power rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_power diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_power_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_power_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_power_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_power_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_secctrl b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_secctrl similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_secctrl rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_secctrl diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_secctrl_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_secctrl_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_secctrl_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_secctrl_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_status b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_status similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_status rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_status diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_status_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_status_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ensemble_status_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ensemble_status_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_meters b/tests/fixtures/7.6.175_envoy_s_metered/ivp_meters similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_meters rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_meters diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_log.json similarity index 89% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_log.json index 5fedff9..13dd169 100644 --- a/tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_log.json +++ b/tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_log.json @@ -4,7 +4,6 @@ "date": "Sun, 03 Sep 2023 12:45:33 GMT", "content-length": "457", "connection": "keep-alive", - "content-type": "application/json", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff" diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_readings b/tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_readings similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_readings rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_readings diff --git a/tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_readings_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_readings_log.json new file mode 100644 index 0000000..dfd66f5 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered/ivp_meters_readings_log.json @@ -0,0 +1,12 @@ +{ + "headers": { + "server": "openresty/1.17.8.1", + "date": "Sun, 03 Sep 2023 12:45:33 GMT", + "content-length": "4843", + "connection": "keep-alive", + "strict-transport-security": "max-age=63072000; includeSubdomains", + "x-frame-options": "DENY", + "x-content-type-options": "nosniff" + }, + "code": 200 +} diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_sc_pvlimit b/tests/fixtures/7.6.175_envoy_s_metered/ivp_sc_pvlimit similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_sc_pvlimit rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_sc_pvlimit diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_sc_pvlimit_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_sc_pvlimit_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_sc_pvlimit_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_sc_pvlimit_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_dry_contact_settings b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_dry_contact_settings similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_dry_contact_settings rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_dry_contact_settings diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_dry_contact_settings_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_dry_contact_settings_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_dry_contact_settings_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_dry_contact_settings_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_config b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_config similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_config rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_config diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_config_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_config_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_config_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_config_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_schedule b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_schedule similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_schedule rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_schedule diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_schedule_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_schedule_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_gen_schedule_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_gen_schedule_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_pel_settings b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_pel_settings similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_pel_settings rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_pel_settings diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_pel_settings_log.json b/tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_pel_settings_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_ss_pel_settings_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/ivp_ss_pel_settings_log.json diff --git a/tests/fixtures/7.6.175_EnvoySMetered/production b/tests/fixtures/7.6.175_envoy_s_metered/production similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/production rename to tests/fixtures/7.6.175_envoy_s_metered/production diff --git a/tests/fixtures/7.6.175_EnvoySMetered/production.json b/tests/fixtures/7.6.175_envoy_s_metered/production.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/production.json rename to tests/fixtures/7.6.175_envoy_s_metered/production.json diff --git a/tests/fixtures/7.6.175_envoy_s_metered/production.json_log.json b/tests/fixtures/7.6.175_envoy_s_metered/production.json_log.json new file mode 100644 index 0000000..b10674a --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered/production.json_log.json @@ -0,0 +1,16 @@ +{ + "headers": { + "server": "openresty/1.17.8.1", + "date": "Sun, 03 Sep 2023 12:45:29 GMT", + "content-type": "application/json", + "transfer-encoding": "chunked", + "connection": "keep-alive", + "pragma": "no-cache", + "expires": "1", + "cache-control": "no-cache", + "strict-transport-security": "max-age=63072000; includeSubdomains", + "x-frame-options": "DENY", + "x-content-type-options": "nosniff" + }, + "code": 200 +} diff --git a/tests/fixtures/7.6.175_EnvoySMetered/production_log.json b/tests/fixtures/7.6.175_envoy_s_metered/production_log.json similarity index 100% rename from tests/fixtures/7.6.175_EnvoySMetered/production_log.json rename to tests/fixtures/7.6.175_envoy_s_metered/production_log.json diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff new file mode 100644 index 0000000..78c5cd4 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff @@ -0,0 +1 @@ +{"tariff":{"currency":{"code":"EUR"},"logger":"mylogger","date":"1688623885","storage_settings":{"mode":"self-consumption","operation_mode_sub_type":"","reserved_soc":30.0,"very_low_soc":10,"charge_from_grid":false,"date":"1688623885"},"single_rate":{"rate":0.38914,"sell":0.0},"seasons":[{"id":"all_year_long","start":"1/1","days":[{"id":"all_days","days":"Mon,Tue,Wed,Thu,Fri,Sat,Sun","must_charge_start":0,"must_charge_duration":0,"must_charge_mode":"CG","enable_discharge_to_grid":false,"periods":[{"id":"filler","start":0,"rate":0.38914},{"id":"period_1","start":420,"rate":0.4424},{"id":"filler","start":1381,"rate":0.38914}]}],"tiers":[]}],"seasons_sell":[]},"schedule":{"source":"Tariff","date":"2023-07-06 06:11:26 UTC","version":"00.00.02","reserved_soc":30.0,"operation_mode_sub_type":"","very_low_soc":10,"charge_from_grid":false,"battery_mode":"self-consumption","schedule":{"Disable":[{"Sun":[{"start":0,"duration":1440,"setting":"ID"}]},{"Mon":[{"start":0,"duration":1440,"setting":"ID"}]},{"Tue":[{"start":0,"duration":1440,"setting":"ID"}]},{"Wed":[{"start":0,"duration":1440,"setting":"ID"}]},{"Thu":[{"start":0,"duration":1440,"setting":"ID"}]},{"Fri":[{"start":0,"duration":1440,"setting":"ID"}]},{"Sat":[{"start":0,"duration":1440,"setting":"ID"}]}],"tariff":[{"start":"1/1","end":"1/1","Sun":[{"start":0,"duration":1440,"setting":"ZN"}],"Mon":[{"start":0,"duration":1440,"setting":"ZN"}],"Tue":[{"start":0,"duration":1440,"setting":"ZN"}],"Wed":[{"start":0,"duration":1440,"setting":"ZN"}],"Thu":[{"start":0,"duration":1440,"setting":"ZN"}],"Fri":[{"start":0,"duration":1440,"setting":"ZN"}],"Sat":[{"start":0,"duration":1440,"setting":"ZN"}]}]},"override":false,"override_backup_soc":30.0,"override_chg_dischg_rate":0.0,"override_tou_mode":"StorageTouMode_DEFAULT_TOU_MODE"}} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff_log.json new file mode 100644 index 0000000..91e471d --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/admin_lib_tariff_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:46 GMT", "content-type": "application/json", "transfer-encoding": "chunked", "connection": "keep-alive", "pragma": "no-cache", "expires": "1", "cache-control": "no-cache", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production new file mode 100644 index 0000000..f18dc40 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production @@ -0,0 +1,6 @@ +{ + "wattHoursToday": 0, + "wattHoursSevenDays": 0, + "wattHoursLifetime": 0, + "wattsNow": 0 +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters new file mode 100644 index 0000000..c773879 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters @@ -0,0 +1,100 @@ +[ + { + "serialNumber": "122107031694", + "lastReportDate": 1694182111, + "devType": 1, + "lastReportWatts": 193, + "maxReportWatts": 289 + }, + { + "serialNumber": "122107031731", + "lastReportDate": 1694182200, + "devType": 1, + "lastReportWatts": 22, + "maxReportWatts": 296 + }, + { + "serialNumber": "122107033673", + "lastReportDate": 1694182140, + "devType": 1, + "lastReportWatts": 21, + "maxReportWatts": 296 + }, + { + "serialNumber": "122107033629", + "lastReportDate": 1694182081, + "devType": 1, + "lastReportWatts": 194, + "maxReportWatts": 289 + }, + { + "serialNumber": "122107035554", + "lastReportDate": 1694182170, + "devType": 1, + "lastReportWatts": 21, + "maxReportWatts": 296 + }, + { + "serialNumber": "122107033602", + "lastReportDate": 1694181992, + "devType": 1, + "lastReportWatts": 22, + "maxReportWatts": 296 + }, + { + "serialNumber": "122107035597", + "lastReportDate": 1694182052, + "devType": 1, + "lastReportWatts": 21, + "maxReportWatts": 296 + }, + { + "serialNumber": "122107032623", + "lastReportDate": 1694181960, + "devType": 1, + "lastReportWatts": 190, + "maxReportWatts": 279 + }, + { + "serialNumber": "122107035544", + "lastReportDate": 1694182140, + "devType": 1, + "lastReportWatts": 191, + "maxReportWatts": 283 + }, + { + "serialNumber": "122107035551", + "lastReportDate": 1694182111, + "devType": 1, + "lastReportWatts": 191, + "maxReportWatts": 287 + }, + { + "serialNumber": "122107032918", + "lastReportDate": 1694181930, + "devType": 1, + "lastReportWatts": 21, + "maxReportWatts": 296 + }, + { + "serialNumber": "122107032940", + "lastReportDate": 1694182172, + "devType": 1, + "lastReportWatts": 21, + "maxReportWatts": 296 + }, + { + "serialNumber": "122107025358", + "lastReportDate": 1694181961, + "devType": 1, + "lastReportWatts": 190, + "maxReportWatts": 279 + }, + { + "serialNumber": "122107032484", + "lastReportDate": 1694182142, + "devType": 1, + "lastReportWatts": 21, + "maxReportWatts": 296 + } +] diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters_log.json new file mode 100644 index 0000000..f2ecf64 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_inverters_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:10:45 GMT", "content-type": "application/json", "content-length": "2109", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_log.json new file mode 100644 index 0000000..16e9f86 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/api_v1_production_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:10:45 GMT", "content-type": "application/json", "content-length": "96", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info new file mode 100644 index 0000000..695fafe --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info @@ -0,0 +1,75 @@ + + + + + 122041077756 + 800-00654-r06 + D7.6.175 + 4c8675 + 0 + 1 + true + + true + + 500-00001-r01 + 02.00.00 + 1210 + + + 500-00011-r02 + 04.04.225 + 3eb4d3 + + + 590-00019-r01 + 02.00.01 + 1f421b + + + 500-00002-r01 + 07.06.175 + f79c8d + + + 500-00005-r01 + 01.02.346 + b1b724 + + + 500-00008-r01 + 02.01.24 + a74d96 + + + 500-00010-r01 + 07.00.20 + 176d57 + + + 500-00013-r01 + 03.02.08 + eaa252 + + + 500-00012-r01 + 02.02.00 + 40061a + + + 500-00016-r01 + 02.00.00 + 54a6dc + + + 500-00001-r01 + 02.00.00 + 1210 + + + ec2-user-envoy_uber-pkg_master:pkg-Jun-22-23-18:55:22 + 1687460237 + 02.00.4238 + 700-GA + + diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info_log.json new file mode 100644 index 0000000..37e0762 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/info_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:10:45 GMT", "content-type": "text/xml", "content-length": "1927", "connection": "keep-alive", "pragma": "no-cache", "expires": "1", "cache-control": "no-cache", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts new file mode 100644 index 0000000..94d047d --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts @@ -0,0 +1,20 @@ +{ + "dry_contacts": [ + { + "id": "NC1", + "status": "open" + }, + { + "id": "NC2", + "status": "open" + }, + { + "id": "NO1", + "status": "open" + }, + { + "id": "NO2", + "status": "open" + } + ] +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts_log.json new file mode 100644 index 0000000..43eddbe --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_dry_contacts_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:47 GMT", "content-length": "330", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator new file mode 100644 index 0000000..e2560ba --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator @@ -0,0 +1,11 @@ +{ + "admin_state": "unknown", + "oper_state": "open", + "admin_mode": 0, + "schedule": 0, + "start_soc": 100, + "stop_soc": -1, + "exc_on": 0, + "present": 1, + "type": 0 +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator_log.json new file mode 100644 index 0000000..1a8acba --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_generator_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:49 GMT", "content-length": "190", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory @@ -0,0 +1 @@ +[] diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory_log.json new file mode 100644 index 0000000..2b159d8 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_inventory_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:47 GMT", "content-length": "2", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power new file mode 100644 index 0000000..25f1e3b --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power @@ -0,0 +1,3 @@ +{ + "devices:": [] +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power_log.json new file mode 100644 index 0000000..e98072f --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_power_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:47 GMT", "content-length": "22", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl new file mode 100644 index 0000000..3db558b --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl @@ -0,0 +1,27 @@ +{ + "shutdown": false, + "freq_bias_hz": 0.0, + "voltage_bias_v": 0.0, + "freq_bias_hz_q8": 0, + "voltage_bias_v_q5": 0, + "freq_bias_hz_phaseb": 0.0, + "voltage_bias_v_phaseb": 0.0, + "freq_bias_hz_q8_phaseb": 0, + "voltage_bias_v_q5_phaseb": 0, + "freq_bias_hz_phasec": 0.0, + "voltage_bias_v_phasec": 0.0, + "freq_bias_hz_q8_phasec": 0, + "voltage_bias_v_q5_phasec": 0, + "configured_backup_soc": 30, + "adjusted_backup_soc": 30, + "agg_soc": 0, + "Max_energy": 0, + "ENC_agg_soc": 0, + "ENC_agg_soh": 0, + "ENC_agg_backup_energy": 0, + "ENC_agg_avail_energy": 0, + "Enc_commissioned_capacity": 0, + "Enc_max_available_capacity": 0, + "ACB_agg_soc": 0, + "ACB_agg_energy": 0 +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl_log.json new file mode 100644 index 0000000..e0b43de --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_secctrl_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:47 GMT", "content-length": "729", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status new file mode 100644 index 0000000..6099e44 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status @@ -0,0 +1,77 @@ +{ + "inventory": { + "serial_nums": {} + }, + "counters": { + "api_ecagtInit": 1, + "api_ecagtTick": 8171232, + "api_ecagtGetDeviceCount": 8188279, + "api_ecagtGetDeviceInfo": 8171233, + "api_ecagtSetSecCtrlBias": 739615, + "api_ecagtGetSecCtrlBias": 50, + "api_ecagtGetSecCtrlBiasQ": 50, + "api_ecagtGetRelayState": 9805503, + "api_ecagtSetDataModelCache": 1, + "api_AggNameplate": 25, + "api_ecagtGetGridFreq": 1634246, + "api_ecagtGetGridVolt": 1634246, + "api_ecagtGetGridFreq_err_notfound": 1634246, + "rest_StatusGet": 26, + "rest_InventoryGet": 51, + "rest_SubmodGet": 14658, + "rest_SecCtrlGet": 25, + "rest_Power": 1, + "ext_zb_send_msg": 5, + "txmsg_OBJ_MDL_SECONDARY_CTRL_REQ": 5, + "zmq_ecaHello": 1, + "zmq_streamdata": 1634246, + "zmq_ecaSecCtrlMsg": 739615, + "zmq_meterlog_ok": 1, + "dmdl_FILES_INDEXED": 3, + "secctrlNotReady": 739610, + "backupSocLimitSet": 739615, + "backupSocLimitChanged": 1, + "api_ecagtGetGenRelayState": 1634246 + }, + "secctrl": { + "shutdown": false, + "freq_bias_hz": 0.0, + "voltage_bias_v": 0.0, + "freq_bias_hz_q8": 0, + "voltage_bias_v_q5": 0, + "freq_bias_hz_phaseb": 0.0, + "voltage_bias_v_phaseb": 0.0, + "freq_bias_hz_q8_phaseb": 0, + "voltage_bias_v_q5_phaseb": 0, + "freq_bias_hz_phasec": 0.0, + "voltage_bias_v_phasec": 0.0, + "freq_bias_hz_q8_phasec": 0, + "voltage_bias_v_q5_phasec": 0, + "configured_backup_soc": 30, + "adjusted_backup_soc": 30, + "agg_soc": 0, + "Max_energy": 0, + "ENC_agg_soc": 0, + "ENC_agg_soh": 0, + "ENC_agg_backup_energy": 0, + "ENC_agg_avail_energy": 0, + "Enc_commissioned_capacity": 0, + "Enc_max_available_capacity": 0, + "ACB_agg_soc": 0, + "ACB_agg_energy": 0 + }, + "relay": { + "mains_admin_state": "closed", + "mains_oper_state": "closed", + "der1_state": 0, + "der2_state": 0, + "Enchg_grid_mode": "unknown", + "Solar_grid_mode": "unknown" + }, + "profile": { + "message": "Obsolete API, please use ivp/arf/profile" + }, + "fakeit": { + "fake_inventory_mode": false + } +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status_log.json new file mode 100644 index 0000000..29c3f8c --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ensemble_status_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:47 GMT", "content-length": "2366", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters new file mode 100644 index 0000000..d655513 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters @@ -0,0 +1,20 @@ +[ + { + "eid": 704643328, + "state": "disabled", + "measurementType": "production", + "phaseMode": "three", + "phaseCount": 3, + "meteringStatus": "normal", + "statusFlags": [] + }, + { + "eid": 704643584, + "state": "disabled", + "measurementType": "net-consumption", + "phaseMode": "three", + "phaseCount": 3, + "meteringStatus": "normal", + "statusFlags": [] + } +] diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_log.json new file mode 100644 index 0000000..970a3a3 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:49 GMT", "content-length": "459", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_readings b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_readings new file mode 100644 index 0000000..405144f --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_readings @@ -0,0 +1,142 @@ +[ + { + "eid": 704643328, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": 0.605, + "activePower": 0.605, + "apparentPower": 1.345, + "reactivePower": 0.073, + "pwrFactor": 0.188, + "voltage": 236.068, + "current": 0.519, + "freq": 50.000, + "channels": [ + { + "eid": 1778385169, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": 0.000, + "activePower": 0.000, + "apparentPower": -0.000, + "reactivePower": 0.000, + "pwrFactor": 0.000, + "voltage": 230.966, + "current": 0.000, + "freq": 50.000 + }, + { + "eid": 1778385170, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": 0.167, + "activePower": 0.167, + "apparentPower": 0.251, + "reactivePower": -0.000, + "pwrFactor": 1.000, + "voltage": 0.990, + "current": 0.252, + "freq": 50.000 + }, + { + "eid": 1778385171, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": 0.437, + "activePower": 0.437, + "apparentPower": 1.094, + "reactivePower": 0.073, + "pwrFactor": 0.000, + "voltage": 4.112, + "current": 0.266, + "freq": 50.000 + } + ] + }, + { + "eid": 704643584, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": -1.459, + "activePower": -1.459, + "apparentPower": 1.752, + "reactivePower": 0.000, + "pwrFactor": -1.000, + "voltage": 239.518, + "current": 0.248, + "freq": 50.000, + "channels": [ + { + "eid": 1778385425, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": 0.000, + "activePower": 0.000, + "apparentPower": -0.000, + "reactivePower": -0.000, + "pwrFactor": -1.000, + "voltage": 230.993, + "current": 0.000, + "freq": 50.000 + }, + { + "eid": 1778385426, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": -1.459, + "activePower": -1.459, + "apparentPower": 1.752, + "reactivePower": 0.000, + "pwrFactor": -1.000, + "voltage": 7.076, + "current": 0.248, + "freq": 50.000 + }, + { + "eid": 1778385427, + "timestamp": 1694182368, + "actEnergyDlvd": 0.000, + "actEnergyRcvd": 0.000, + "apparentEnergy": 0.000, + "reactEnergyLagg": 0.000, + "reactEnergyLead": 0.000, + "instantaneousDemand": -0.000, + "activePower": -0.000, + "apparentPower": 0.000, + "reactivePower": -0.000, + "pwrFactor": -1.000, + "voltage": 1.449, + "current": -0.000, + "freq": 50.000 + } + ] + } +] diff --git a/tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_readings_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_readings_log.json similarity index 55% rename from tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_readings_log.json rename to tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_readings_log.json index 8163719..f56e53a 100644 --- a/tests/fixtures/7.6.175_EnvoySMetered/ivp_meters_readings_log.json +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_meters_readings_log.json @@ -1 +1 @@ -{"headers": {"server": "openresty/1.17.8.1", "date": "Sun, 03 Sep 2023 12:45:33 GMT", "content-length": "4843", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:49 GMT", "content-length": "4688", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit new file mode 100644 index 0000000..82d1e39 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit @@ -0,0 +1,4 @@ +{ + "enable": false, + "pv_limit_pct": 100 +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit_log.json new file mode 100644 index 0000000..f28414b --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_sc_pvlimit_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:49 GMT", "content-length": "48", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings new file mode 100644 index 0000000..6fd1380 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings @@ -0,0 +1,56 @@ +{ + "dry_contacts": [ + { + "id": "NC1", + "type": "NONE", + "grid_action": "none", + "micro_grid_action": "none", + "gen_action": "none", + "override": "false", + "load_name": "", + "mode": "manual", + "soc_low": 30.0, + "soc_high": 70.0, + "pv_serial_nb": [] + }, + { + "id": "NC2", + "type": "NONE", + "grid_action": "none", + "micro_grid_action": "none", + "gen_action": "none", + "override": "false", + "load_name": "", + "mode": "manual", + "soc_low": 30.0, + "soc_high": 70.0, + "pv_serial_nb": [] + }, + { + "id": "NO1", + "type": "NONE", + "grid_action": "none", + "micro_grid_action": "none", + "gen_action": "none", + "override": "false", + "load_name": "", + "mode": "manual", + "soc_low": 30.0, + "soc_high": 70.0, + "pv_serial_nb": [] + }, + { + "id": "NO2", + "type": "NONE", + "grid_action": "none", + "micro_grid_action": "none", + "gen_action": "none", + "override": "false", + "load_name": "", + "mode": "manual", + "soc_low": 30.0, + "soc_high": 70.0, + "pv_serial_nb": [] + } + ] +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings_log.json new file mode 100644 index 0000000..fed303c --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_dry_contact_settings_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:47 GMT", "content-length": "1494", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config @@ -0,0 +1 @@ +{} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config_log.json new file mode 100644 index 0000000..550a461 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_config_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:49 GMT", "content-length": "2", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule @@ -0,0 +1 @@ +{} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule_log.json new file mode 100644 index 0000000..550a461 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_gen_schedule_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:49 GMT", "content-length": "2", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings new file mode 100644 index 0000000..288a1a0 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings @@ -0,0 +1,3 @@ +{ + "PEL": false +} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings_log.json new file mode 100644 index 0000000..0b87fc6 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/ivp_ss_pel_settings_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:12:49 GMT", "content-length": "20", "connection": "keep-alive", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production new file mode 100644 index 0000000..56e3b0a --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production @@ -0,0 +1 @@ +{"production":[{"type":"inverters","activeCount":14,"readingTime":1694182292,"wNow":1317,"whLifetime":1152900},{"type":"eim","activeCount":0,"measurementType":"production","readingTime":1694182307,"wNow":0.71,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":0.521,"rmsVoltage":236.127,"reactPwr":0.0,"apprntPwr":1.353,"pwrFactor":0.81,"whToday":0.0,"whLastSevenDays":0.0,"vahToday":0.0,"varhLeadToday":0.0,"varhLagToday":0.0}],"consumption":[{"type":"eim","activeCount":0,"measurementType":"total-consumption","readingTime":1694182307,"wNow":-0.749,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":0.274,"rmsVoltage":239.62,"reactPwr":0.0,"apprntPwr":0.436,"pwrFactor":-1.0,"whToday":0.0,"whLastSevenDays":0.0,"vahToday":0.0,"varhLeadToday":0.0,"varhLagToday":0.0},{"type":"eim","activeCount":0,"measurementType":"net-consumption","readingTime":1694182307,"wNow":-1.459,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":-0.247,"rmsVoltage":239.62,"reactPwr":0.0,"apprntPwr":-1.752,"pwrFactor":-1.0,"whToday":0,"whLastSevenDays":0,"vahToday":0,"varhLeadToday":0,"varhLagToday":0}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production.json new file mode 100644 index 0000000..2021898 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production.json @@ -0,0 +1 @@ +{"production":[{"type":"inverters","activeCount":14,"readingTime":1694182262,"wNow":1322,"whLifetime":1152866},{"type":"eim","activeCount":0,"measurementType":"production","readingTime":1694182274,"wNow":0.641,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":0.516,"rmsVoltage":235.291,"reactPwr":0.0,"apprntPwr":1.335,"pwrFactor":1.0,"whToday":0.0,"whLastSevenDays":0.0,"vahToday":0.0,"varhLeadToday":0.0,"varhLagToday":0.0}],"consumption":[{"type":"eim","activeCount":0,"measurementType":"total-consumption","readingTime":1694182274,"wNow":-0.768,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":0.27,"rmsVoltage":238.786,"reactPwr":0.0,"apprntPwr":0.412,"pwrFactor":-1.0,"whToday":0.0,"whLastSevenDays":0.0,"vahToday":0.0,"varhLeadToday":0.0,"varhLagToday":0.0},{"type":"eim","activeCount":0,"measurementType":"net-consumption","readingTime":1694182274,"wNow":-1.409,"whLifetime":0.0,"varhLeadLifetime":0.0,"varhLagLifetime":0.0,"vahLifetime":0.0,"rmsCurrent":-0.247,"rmsVoltage":238.786,"reactPwr":0.0,"apprntPwr":-1.746,"pwrFactor":-1.0,"whToday":0,"whLastSevenDays":0,"vahToday":0,"varhLeadToday":0,"varhLagToday":0}],"storage":[{"type":"acb","activeCount":0,"readingTime":0,"wNow":0,"whNow":0,"state":"idle"}]} diff --git a/tests/fixtures/7.6.175_EnvoySMetered/production.json_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production.json_log.json similarity index 67% rename from tests/fixtures/7.6.175_EnvoySMetered/production.json_log.json rename to tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production.json_log.json index 03a36d6..021eef9 100644 --- a/tests/fixtures/7.6.175_EnvoySMetered/production.json_log.json +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production.json_log.json @@ -1 +1 @@ -{"headers": {"server": "openresty/1.17.8.1", "date": "Sun, 03 Sep 2023 12:45:29 GMT", "content-type": "application/json", "transfer-encoding": "chunked", "connection": "keep-alive", "pragma": "no-cache", "expires": "1", "cache-control": "no-cache", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:14 GMT", "content-type": "application/json", "transfer-encoding": "chunked", "connection": "keep-alive", "pragma": "no-cache", "expires": "1", "cache-control": "no-cache", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production_log.json b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production_log.json new file mode 100644 index 0000000..7a75135 --- /dev/null +++ b/tests/fixtures/7.6.175_envoy_s_metered_cts_disabled/production_log.json @@ -0,0 +1 @@ +{"headers": {"server": "openresty/1.17.8.1", "date": "Fri, 08 Sep 2023 14:11:47 GMT", "content-type": "application/json", "transfer-encoding": "chunked", "connection": "keep-alive", "pragma": "no-cache", "expires": "1", "cache-control": "no-cache", "strict-transport-security": "max-age=63072000; includeSubdomains", "x-frame-options": "DENY", "x-content-type-options": "nosniff"}, "code": 200} diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 607ef08..ee0f076 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -1,4 +1,4 @@ -"""Tests module""" +"""Testing module.""" import json import logging @@ -11,7 +11,7 @@ from custom_components.enphase_gateway.gateway_reader import GatewayReader from custom_components.enphase_gateway.gateway_reader.auth import LegacyAuth -LOGGER = logging.getLogger(__name__) +_LOGGER = logging.getLogger(__name__) FIXTURES_DIR = Path(__file__).parent.joinpath("fixtures") @@ -36,25 +36,23 @@ async def gen_response(name, path): with fp_log.open() as json_file: log_data = json.load(json_file) status_code = log_data.get("code", 200) - headers = log_data.get("headers", None) + headers = log_data.get("headers", {}) else: status_code = 200 - headers = None + headers = {} - with fp.open() as file: - response_data = file.read() - - if fp.stem == ".json": + with fp.open("r") as file: + if headers.get("content-type", None) == "application/json": return Response( status_code=status_code, headers=headers, - json=json.loads(response_data), + json=json.load(file), ) else: return Response( status_code=status_code, headers=headers, - text=response_data, + content=file.read(), ) @@ -73,7 +71,6 @@ async def get_gateway(fixture_name): "username", "password", ) - # authenticate("username", "password") for endpoint in gateway_reader.gateway.required_endpoints: return_value = await gen_response(fixture_name, endpoint.path) @@ -87,15 +84,20 @@ async def get_gateway(fixture_name): @pytest.mark.asyncio @respx.mock async def test_with_3_7_0_firmware(): - """Test with 3.7.0 firmware.""" + """Test with 3.7.0 firmware. + + Fixtures represent an Envoy-R with the old firmware. + + """ # Config ---> - fixture_name = "3.7.0" + fixture_name = "3.7.0_envoy_r" gateway_class = "EnvoyLegacy" gateway = await get_gateway(fixture_name) assert gateway.__class__.__name__ == gateway_class + # production data assert gateway.production == 6.63 * 1000 assert gateway.daily_production == 53.6 * 1000 assert gateway.seven_days_production == 405 * 1000 @@ -105,19 +107,25 @@ async def test_with_3_7_0_firmware(): @pytest.mark.asyncio @respx.mock async def test_with_3_9_36_firmware(): - """Test with 3.9.36 firmware.""" + """Test with 3.9.36 firmware. + + Fixtures represent an Envoy-R with the new firmware. + + """ # Config ---> - fixture_name = "3.9.36" + fixture_name = "3.9.36_envoy_r" gateway_class = "Envoy" gateway = await get_gateway(fixture_name) assert gateway.__class__.__name__ == gateway_class + # production data assert gateway.production == 1271 assert gateway.daily_production == 1460 assert gateway.seven_days_production == 130349 assert gateway.lifetime_production == 6012540 + # inverters assert gateway.inverters_production["121547060495"] == { "serialNumber": "121547060495", "lastReportDate": 1618083959, @@ -126,44 +134,88 @@ async def test_with_3_9_36_firmware(): } -# @pytest.mark.asyncio -# @respx.mock -# async def test_with_7_6_175_firmware(): -# """Test with 7.6.175 firmware.""" -# # Config ---> -# fixture_name = "7.6.175_EnvoySMetered" -# gateway_class = "EnvoySMetered" - -# gateway = await get_gateway(fixture_name) -# print(gateway.required_endpoints) -# print(gateway.data) - -# # gateway class -# assert gateway.__class__.__name__ == gateway_class - -# # meter configuration -# assert gateway.production_meter == 704643328 -# assert gateway.net_consumption_meter == 704643584 - -# # production data -# assert gateway.production == 488.925 -# assert gateway.daily_production == 4425.303 -# assert gateway.seven_days_production == 111093.303 -# assert gateway.lifetime_production == 3183793.885 -# assert gateway.consumption is not None -# assert gateway.daily_consumption == 19903.621 -# assert gateway.seven_days_consumption == 4.621 -# assert gateway.lifetime_consumption is not None - -# # battery data -# assert gateway.encharge_inventory is None -# assert gateway.encharge_power is None - -# # inverters -# assert gateway.inverters_production["482243031579"] == { -# "serialNumber": "482243031579", -# "lastReportDate": 1693744825, -# "devType": 1, -# "lastReportWatts": 135, -# "maxReportWatts": 365 -# } +@pytest.mark.asyncio +@respx.mock +async def test_with_7_6_175_firmware(): + """Test with 7.6.175 firmware. + + Fixtures represent an Envoy-S Metered in a normal configuration. + + """ + # Config ---> + fixture_name = "7.6.175_envoy_s_metered" + gateway_class = "EnvoySMetered" + + gateway = await get_gateway(fixture_name) + + # gateway class + assert gateway.__class__.__name__ == gateway_class + # meter configuration + assert gateway.production_meter == 704643328 + assert gateway.net_consumption_meter == 704643584 + assert gateway.total_consumption_meter is None + # production data + assert gateway.production == 488.925 + assert gateway.daily_production == 4425.303 + assert gateway.seven_days_production == 111093.303 + assert gateway.lifetime_production == 3183793.885 + # consumption data + assert gateway.consumption is not None + assert gateway.daily_consumption == 19903.621 + assert gateway.seven_days_consumption == 4.621 + assert gateway.lifetime_consumption is not None + # battery data + assert gateway.encharge_inventory is None + assert gateway.encharge_power is None + # inverters + assert gateway.inverters_production["482243031579"] == { + "serialNumber": "482243031579", + "lastReportDate": 1693744825, + "devType": 1, + "lastReportWatts": 135, + "maxReportWatts": 365 + } + + +@pytest.mark.asyncio +@respx.mock +async def test_with_7_6_175_firmware_cts_disabled(): + """Test with 7.6.175 firmware with disabled current transformers. + + Fixtures represent an Envoy-S Metered where both the production and + the consumption meters are disabled. + + """ + # Config ---> + fixture_name = "7.6.175_envoy_s_metered_cts_disabled" + gateway_class = "EnvoySMeteredCtDisabled" + + gateway = await get_gateway(fixture_name) + + # gateway class + assert gateway.__class__.__name__ == gateway_class + # meter configuration + assert gateway.production_meter is None + assert gateway.net_consumption_meter is None + assert gateway.total_consumption_meter is None + # production data + assert gateway.production == 1322 + assert gateway.daily_production is None + assert gateway.seven_days_production is None + assert gateway.lifetime_production == 1152866 + # consumption data + assert gateway.consumption is None + assert gateway.daily_consumption is None + assert gateway.seven_days_consumption is None + assert gateway.lifetime_consumption is None + # battery data + assert gateway.encharge_inventory is None + assert gateway.encharge_power is None + # inverters + assert gateway.inverters_production["122107032918"] == { + "serialNumber": "122107032918", + "lastReportDate": 1694181930, + "devType": 1, + "lastReportWatts": 21, + "maxReportWatts": 296 + }