From bfd896264e9feeea94e1899e022c03e0a81fa78e Mon Sep 17 00:00:00 2001 From: Germain LEFEBVRE Date: Tue, 20 Aug 2024 22:24:01 +0200 Subject: [PATCH] chore: generate json schemas --- schemas/get_consumption_overview.json | 34 +++++++------- schemas/get_energy_insights.json | 10 +---- schemas/get_home.json | 8 ++++ schemas/get_installations.json | 8 ++++ schemas/get_invitations.json | 8 ++++ schemas/get_report.json | 29 ++---------- schemas/get_state.json | 64 +++++++++++++++++++++------ tox.ini | 2 +- 8 files changed, 96 insertions(+), 67 deletions(-) diff --git a/schemas/get_consumption_overview.json b/schemas/get_consumption_overview.json index f7a90af..6e60f48 100644 --- a/schemas/get_consumption_overview.json +++ b/schemas/get_consumption_overview.json @@ -18,10 +18,10 @@ "type": "string" }, "totalConsumption": { - "type": "number" + "type": "integer" }, "totalCostInCents": { - "type": "number" + "type": "integer" }, "consumptionPerDate": { "type": "array", @@ -32,10 +32,10 @@ "type": "string" }, "consumption": { - "type": "number" + "type": "integer" }, "costInCents": { - "type": "number" + "type": "integer" } }, "required": [ @@ -64,10 +64,10 @@ "type": "string" }, "totalConsumption": { - "type": "number" + "type": "integer" }, "totalCostInCents": { - "type": "number" + "type": "integer" }, "consumptionPerDate": { "type": "array", @@ -78,10 +78,10 @@ "type": "string" }, "consumption": { - "type": "number" + "type": "integer" }, "costInCents": { - "type": "number" + "type": "integer" } }, "required": [ @@ -110,10 +110,10 @@ "type": "string" }, "totalConsumption": { - "type": "number" + "type": "integer" }, "totalCostInCents": { - "type": "number" + "type": "integer" }, "consumptionPerDate": { "type": "array", @@ -124,10 +124,10 @@ "type": "string" }, "consumption": { - "type": "number" + "type": "integer" }, "costInCents": { - "type": "number" + "type": "integer" } }, "required": [ @@ -156,10 +156,10 @@ "type": "string" }, "totalConsumption": { - "type": "number" + "type": "integer" }, "totalCostInCents": { - "type": "number" + "type": "integer" }, "consumptionPerDate": { "type": "array", @@ -170,10 +170,10 @@ "type": "string" }, "consumption": { - "type": "number" + "type": "integer" }, "costInCents": { - "type": "number" + "type": "integer" } }, "required": [ @@ -207,7 +207,7 @@ "type": "object", "properties": { "totalSavingsInPercent": { - "type": "number" + "type": "null" }, "yearMonth": { "type": "string" diff --git a/schemas/get_energy_insights.json b/schemas/get_energy_insights.json index 036d4c9..54af8ca 100644 --- a/schemas/get_energy_insights.json +++ b/schemas/get_energy_insights.json @@ -150,15 +150,7 @@ ] }, "costForecast": { - "type": "object", - "properties": { - "costEndOfMonthInCents": { - "type": "number" - } - }, - "required": [ - "costEndOfMonthInCents" - ] + "type": "null" }, "weatherComparison": { "type": "object", diff --git a/schemas/get_home.json b/schemas/get_home.json index 2639149..fbb9812 100644 --- a/schemas/get_home.json +++ b/schemas/get_home.json @@ -50,6 +50,9 @@ "zonesCount": { "type": "integer" }, + "language": { + "type": "string" + }, "skills": { "type": "array", "items": { @@ -148,6 +151,9 @@ "isHeatSourceInstalled": { "type": "boolean" }, + "isHeatPumpInstalled": { + "type": "boolean" + }, "isBalanceHpEligible": { "type": "boolean" } @@ -170,7 +176,9 @@ "isBalanceAcEligible", "isBalanceHpEligible", "isEnergyIqEligible", + "isHeatPumpInstalled", "isHeatSourceInstalled", + "language", "name", "partner", "showAutoAssistReminders", diff --git a/schemas/get_installations.json b/schemas/get_installations.json index 2639149..fbb9812 100644 --- a/schemas/get_installations.json +++ b/schemas/get_installations.json @@ -50,6 +50,9 @@ "zonesCount": { "type": "integer" }, + "language": { + "type": "string" + }, "skills": { "type": "array", "items": { @@ -148,6 +151,9 @@ "isHeatSourceInstalled": { "type": "boolean" }, + "isHeatPumpInstalled": { + "type": "boolean" + }, "isBalanceHpEligible": { "type": "boolean" } @@ -170,7 +176,9 @@ "isBalanceAcEligible", "isBalanceHpEligible", "isEnergyIqEligible", + "isHeatPumpInstalled", "isHeatSourceInstalled", + "language", "name", "partner", "showAutoAssistReminders", diff --git a/schemas/get_invitations.json b/schemas/get_invitations.json index fc993db..4c23b2a 100644 --- a/schemas/get_invitations.json +++ b/schemas/get_invitations.json @@ -106,6 +106,9 @@ "zonesCount": { "type": "integer" }, + "language": { + "type": "string" + }, "skills": { "type": "array", "items": { @@ -204,6 +207,9 @@ "isHeatSourceInstalled": { "type": "boolean" }, + "isHeatPumpInstalled": { + "type": "boolean" + }, "isBalanceHpEligible": { "type": "boolean" } @@ -226,7 +232,9 @@ "isBalanceAcEligible", "isBalanceHpEligible", "isEnergyIqEligible", + "isHeatPumpInstalled", "isHeatSourceInstalled", + "language", "name", "partner", "showAutoAssistReminders", diff --git a/schemas/get_report.json b/schemas/get_report.json index cab9ded..12ed721 100644 --- a/schemas/get_report.json +++ b/schemas/get_report.json @@ -231,19 +231,7 @@ "type": "string" }, "temperature": { - "type": "object", - "properties": { - "celsius": { - "type": "number" - }, - "fahrenheit": { - "type": "number" - } - }, - "required": [ - "celsius", - "fahrenheit" - ] + "type": "null" } }, "required": [ @@ -254,6 +242,7 @@ } }, "required": [ + "setting", "stripeType" ] } @@ -302,19 +291,7 @@ "type": "string" }, "temperature": { - "type": "object", - "properties": { - "celsius": { - "type": "number" - }, - "fahrenheit": { - "type": "number" - } - }, - "required": [ - "celsius", - "fahrenheit" - ] + "type": "null" } }, "required": [ diff --git a/schemas/get_state.json b/schemas/get_state.json index 2bda573..5581b7c 100644 --- a/schemas/get_state.json +++ b/schemas/get_state.json @@ -24,33 +24,69 @@ "type": "string" }, "temperature": { + "type": "null" + } + }, + "required": [ + "power", + "temperature", + "type" + ] + }, + "overlayType": { + "type": "string" + }, + "overlay": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "setting": { "type": "object", "properties": { - "celsius": { - "type": "number" + "type": { + "type": "string" }, - "fahrenheit": { - "type": "number" + "power": { + "type": "string" + }, + "temperature": { + "type": "null" } }, "required": [ - "celsius", - "fahrenheit" + "power", + "temperature", + "type" + ] + }, + "termination": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "typeSkillBasedApp": { + "type": "string" + }, + "projectedExpiry": { + "type": "null" + } + }, + "required": [ + "projectedExpiry", + "type", + "typeSkillBasedApp" ] } }, "required": [ - "power", - "temperature", + "setting", + "termination", "type" ] }, - "overlayType": { - "type": "null" - }, - "overlay": { - "type": "null" - }, "openWindow": { "type": "null" }, diff --git a/tox.ini b/tox.ini index b173e27..e3accbf 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ commands = [testenv:unittest] description = run unit tests commands = - pytest tests/ + pytest tests/api/test_api.py tests/api/test_tado.py [testenv:generate_json_schemas] description = run json schemas generation