Skip to content

Commit

Permalink
chore: generate json schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
germainlefebvre4 committed Aug 20, 2024
1 parent ccf1a07 commit bfd8962
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 67 deletions.
34 changes: 17 additions & 17 deletions schemas/get_consumption_overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"type": "string"
},
"totalConsumption": {
"type": "number"
"type": "integer"
},
"totalCostInCents": {
"type": "number"
"type": "integer"
},
"consumptionPerDate": {
"type": "array",
Expand All @@ -32,10 +32,10 @@
"type": "string"
},
"consumption": {
"type": "number"
"type": "integer"
},
"costInCents": {
"type": "number"
"type": "integer"
}
},
"required": [
Expand Down Expand Up @@ -64,10 +64,10 @@
"type": "string"
},
"totalConsumption": {
"type": "number"
"type": "integer"
},
"totalCostInCents": {
"type": "number"
"type": "integer"
},
"consumptionPerDate": {
"type": "array",
Expand All @@ -78,10 +78,10 @@
"type": "string"
},
"consumption": {
"type": "number"
"type": "integer"
},
"costInCents": {
"type": "number"
"type": "integer"
}
},
"required": [
Expand Down Expand Up @@ -110,10 +110,10 @@
"type": "string"
},
"totalConsumption": {
"type": "number"
"type": "integer"
},
"totalCostInCents": {
"type": "number"
"type": "integer"
},
"consumptionPerDate": {
"type": "array",
Expand All @@ -124,10 +124,10 @@
"type": "string"
},
"consumption": {
"type": "number"
"type": "integer"
},
"costInCents": {
"type": "number"
"type": "integer"
}
},
"required": [
Expand Down Expand Up @@ -156,10 +156,10 @@
"type": "string"
},
"totalConsumption": {
"type": "number"
"type": "integer"
},
"totalCostInCents": {
"type": "number"
"type": "integer"
},
"consumptionPerDate": {
"type": "array",
Expand All @@ -170,10 +170,10 @@
"type": "string"
},
"consumption": {
"type": "number"
"type": "integer"
},
"costInCents": {
"type": "number"
"type": "integer"
}
},
"required": [
Expand Down Expand Up @@ -207,7 +207,7 @@
"type": "object",
"properties": {
"totalSavingsInPercent": {
"type": "number"
"type": "null"
},
"yearMonth": {
"type": "string"
Expand Down
10 changes: 1 addition & 9 deletions schemas/get_energy_insights.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,7 @@
]
},
"costForecast": {
"type": "object",
"properties": {
"costEndOfMonthInCents": {
"type": "number"
}
},
"required": [
"costEndOfMonthInCents"
]
"type": "null"
},
"weatherComparison": {
"type": "object",
Expand Down
8 changes: 8 additions & 0 deletions schemas/get_home.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"zonesCount": {
"type": "integer"
},
"language": {
"type": "string"
},
"skills": {
"type": "array",
"items": {
Expand Down Expand Up @@ -148,6 +151,9 @@
"isHeatSourceInstalled": {
"type": "boolean"
},
"isHeatPumpInstalled": {
"type": "boolean"
},
"isBalanceHpEligible": {
"type": "boolean"
}
Expand All @@ -170,7 +176,9 @@
"isBalanceAcEligible",
"isBalanceHpEligible",
"isEnergyIqEligible",
"isHeatPumpInstalled",
"isHeatSourceInstalled",
"language",
"name",
"partner",
"showAutoAssistReminders",
Expand Down
8 changes: 8 additions & 0 deletions schemas/get_installations.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"zonesCount": {
"type": "integer"
},
"language": {
"type": "string"
},
"skills": {
"type": "array",
"items": {
Expand Down Expand Up @@ -148,6 +151,9 @@
"isHeatSourceInstalled": {
"type": "boolean"
},
"isHeatPumpInstalled": {
"type": "boolean"
},
"isBalanceHpEligible": {
"type": "boolean"
}
Expand All @@ -170,7 +176,9 @@
"isBalanceAcEligible",
"isBalanceHpEligible",
"isEnergyIqEligible",
"isHeatPumpInstalled",
"isHeatSourceInstalled",
"language",
"name",
"partner",
"showAutoAssistReminders",
Expand Down
8 changes: 8 additions & 0 deletions schemas/get_invitations.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
"zonesCount": {
"type": "integer"
},
"language": {
"type": "string"
},
"skills": {
"type": "array",
"items": {
Expand Down Expand Up @@ -204,6 +207,9 @@
"isHeatSourceInstalled": {
"type": "boolean"
},
"isHeatPumpInstalled": {
"type": "boolean"
},
"isBalanceHpEligible": {
"type": "boolean"
}
Expand All @@ -226,7 +232,9 @@
"isBalanceAcEligible",
"isBalanceHpEligible",
"isEnergyIqEligible",
"isHeatPumpInstalled",
"isHeatSourceInstalled",
"language",
"name",
"partner",
"showAutoAssistReminders",
Expand Down
29 changes: 3 additions & 26 deletions schemas/get_report.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,7 @@
"type": "string"
},
"temperature": {
"type": "object",
"properties": {
"celsius": {
"type": "number"
},
"fahrenheit": {
"type": "number"
}
},
"required": [
"celsius",
"fahrenheit"
]
"type": "null"
}
},
"required": [
Expand All @@ -254,6 +242,7 @@
}
},
"required": [
"setting",
"stripeType"
]
}
Expand Down Expand Up @@ -302,19 +291,7 @@
"type": "string"
},
"temperature": {
"type": "object",
"properties": {
"celsius": {
"type": "number"
},
"fahrenheit": {
"type": "number"
}
},
"required": [
"celsius",
"fahrenheit"
]
"type": "null"
}
},
"required": [
Expand Down
64 changes: 50 additions & 14 deletions schemas/get_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfd8962

Please sign in to comment.