diff --git a/.github/workflows/release-feat-dryrun.yml b/.github/workflows/release-feat-dryrun.yml index cc5670b..b46fe18 100644 --- a/.github/workflows/release-feat-dryrun.yml +++ b/.github/workflows/release-feat-dryrun.yml @@ -96,10 +96,11 @@ jobs: poetry publish -r test-pypi if: needs.release.outputs.new_release_published == 'true' - - name: Clean PyPi release - if: always() - run: | - poetry add pypi-cleanup - poetry run pypi-cleanup --host https://test.pypi.org --username '__token__' --package libtado --do-it - env: - PYPI_CLEANUP_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} + # - name: Clean PyPi release + # if: always() + # run: | + # poetry add pypi-cleanup + # poetry run pypi-cleanup --host https://test.pypi.org --username $PYPI_CLEANUP_USERNAME --package libtado --do-it + # env: + # PYPI_CLEANUP_USERNAME: ${{ secrets.PYPI_TEST_USERNAME }} + # PYPI_CLEANUP_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} diff --git a/check.py b/check.py index 919dd9f..0e300b9 100644 --- a/check.py +++ b/check.py @@ -31,4 +31,5 @@ # print(tado.set_away_configuration(6, "HEATING", "MEDIUM", 16)) # print(tado.set_zone_order([{"id":1},{"id":6},{"id":11},{"id":12}])) # print(tado.set_invitation("germain@libtado.fr")) -print(tado.delete_invitation("aa21a793520c4b9eb4559bc5fb560291")) +# print(tado.delete_invitation("aa21a793520c4b9eb4559bc5fb560291")) +print(tado.get_consumption_details("2025-01")) diff --git a/docs/contributing.md b/docs/contributing.md index 03759c8..7a4544a 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -95,3 +95,17 @@ tox -e py3.11,lint,generate_json_schemas,unittest ``` The pull request checking pipeline will run the same commands on several python versions to ensure the compatibility of the library. + +## Clean the releases on PyPi + +Every commit on feature branches will generate a new release on PyPi Test to ensure everything is working fine on release management. + +Only admins can do this part. + +Delete the release on PyPi Test: + +```bash +export PYPI_CLEANUP_USERNAME="" +export PYPI_CLEANUP_PASSWORD="" +pypi-cleanup --host https://test.pypi.org --username $PYPI_CLEANUP_USERNAME --package libtado +``` diff --git a/libtado/__main__.py b/libtado/__main__.py index 81ee311..6c9bd16 100755 --- a/libtado/__main__.py +++ b/libtado/__main__.py @@ -521,5 +521,25 @@ def schedule_block_day_type(tado, zone, schedule, day_type): click.echo('') +@main.command() +@click.pass_obj +@click.option('--month-date', '-d', required=True, type=str, help='Month year (i.e. 2022-09)') +def consumption_details(tado, month_date): + """Get the consumption details of your home.""" + consumption_details = tado.get_consumption_details(month_date) + + click.echo('Consumption for %s' % (month_date)) + click.echo('') + + click.echo('Summary:') + click.echo(' Consumption (%s): %d' % (consumption_details['summary']['unit'], consumption_details['summary']['consumption'])) + click.echo(' Cost: %.2f' % (consumption_details['summary']['costInCents']/100)) + click.echo('') + + click.echo('Details:') + for cd in consumption_details['graphConsumption']['monthlyAggregation']['requestedMonth']['consumptionPerDate']: + click.echo(' %s\tConsumption (%s): %s\t\tCost: %.2f' % (cd['date'], consumption_details['graphConsumption']['unit'], cd['consumption'], cd['costInCents']/100)) + + if __name__ == "__main__": main() diff --git a/libtado/api.py b/libtado/api.py index 5f464af..cfe2cf6 100644 --- a/libtado/api.py +++ b/libtado/api.py @@ -640,78 +640,78 @@ def set_invitation(self, email): (dict): The invitation information. ??? info "Result example" - ```json - { - "token": "44483e1d07qf439&8b786fc0372ec315", - "email": "SOME_EMAIL", - "firstSent": "2024-03-19T12:54:38.591Z", - "lastSent": "2024-03-19T12:54:38.591Z", - "inviter": { - "name": "SOME_NAME", - "email": "SOME_EMAIL", - "username": "SOME_MAIL", - "enabled": true, - "id": "5c22a9b6d5018000088dba4a", - "homeId": 123456, - "locale": "fr", - "type": "WEB_USER" - }, - "home": { - "id": 123456, - "name": "Domicile", - "dateTimeZone": "Europe/Paris", - "dateCreated": "2018-12-25T20:58:28.674Z", - "temperatureUnit": "CELSIUS", - "partner": null, - "simpleSmartScheduleEnabled": true, - "awayRadiusInMeters": 1999.68, - "installationCompleted": true, - "incidentDetection": { - "supported": true, - "enabled": true - }, - "generation": "PRE_LINE_X", - "zonesCount": 4, - "skills": [ - "AUTO_ASSIST" - ], - "christmasModeEnabled": true, - "showAutoAssistReminders": true, - "contactDetails": { - "name": "SOME_NAME", - "email": "SOME_EMAIL", - "phone": "SOME_PHONE_NUMBER" - }, - "address": { - "addressLine1": "SOME_POSTAL_ADDRESS", - "addressLine2": null, - "zipCode": "SOME_POSTCODE", - "city": "SOME_CITY", - "state": null, - "country": "FRA" - }, - "geolocation": { - "latitude": 12.3456789, - "longitude": 1.23456 - }, - "consentGrantSkippable": true, - "enabledFeatures": [ - "CLIMATE_REPORT_AS_WEBVIEW", - "EIQ_SETTINGS_AS_WEBVIEW", - "ENERGY_IQ_V2_ONBOARDING", - "HIDE_BOILER_REPAIR_SERVICE", - "KEEP_WEBAPP_UPDATED", - "OWD_SETTINGS_AS_WEBVIEW", - "SMART_SCHEDULE_AS_WEBVIEW" - ], - "isAirComfortEligible": true, - "isBalanceAcEligible": false, - "isEnergyIqEligible": true, - "isHeatSourceInstalled": false, - "isBalanceHpEligible": false - } - } - ``` + ```json + { + "token": "44483e1d07qf439&8b786fc0372ec315", + "email": "SOME_EMAIL", + "firstSent": "2024-03-19T12:54:38.591Z", + "lastSent": "2024-03-19T12:54:38.591Z", + "inviter": { + "name": "SOME_NAME", + "email": "SOME_EMAIL", + "username": "SOME_MAIL", + "enabled": true, + "id": "5c22a9b6d5018000088dba4a", + "homeId": 123456, + "locale": "fr", + "type": "WEB_USER" + }, + "home": { + "id": 123456, + "name": "Domicile", + "dateTimeZone": "Europe/Paris", + "dateCreated": "2018-12-25T20:58:28.674Z", + "temperatureUnit": "CELSIUS", + "partner": null, + "simpleSmartScheduleEnabled": true, + "awayRadiusInMeters": 1999.68, + "installationCompleted": true, + "incidentDetection": { + "supported": true, + "enabled": true + }, + "generation": "PRE_LINE_X", + "zonesCount": 4, + "skills": [ + "AUTO_ASSIST" + ], + "christmasModeEnabled": true, + "showAutoAssistReminders": true, + "contactDetails": { + "name": "SOME_NAME", + "email": "SOME_EMAIL", + "phone": "SOME_PHONE_NUMBER" + }, + "address": { + "addressLine1": "SOME_POSTAL_ADDRESS", + "addressLine2": null, + "zipCode": "SOME_POSTCODE", + "city": "SOME_CITY", + "state": null, + "country": "FRA" + }, + "geolocation": { + "latitude": 12.3456789, + "longitude": 1.23456 + }, + "consentGrantSkippable": true, + "enabledFeatures": [ + "CLIMATE_REPORT_AS_WEBVIEW", + "EIQ_SETTINGS_AS_WEBVIEW", + "ENERGY_IQ_V2_ONBOARDING", + "HIDE_BOILER_REPAIR_SERVICE", + "KEEP_WEBAPP_UPDATED", + "OWD_SETTINGS_AS_WEBVIEW", + "SMART_SCHEDULE_AS_WEBVIEW" + ], + "isAirComfortEligible": true, + "isBalanceAcEligible": false, + "isEnergyIqEligible": true, + "isHeatSourceInstalled": false, + "isBalanceHpEligible": false + } + } + ``` """ payload = { 'email': email } return self._api_call('homes/%i/invitations' % (self.id), data=payload, method='POST') @@ -2538,6 +2538,187 @@ def get_consumption_overview(self, monthYear, country, ngsw_bypass=True): data = self._api_energy_insights_call('homes/%i/consumptionOverview?month=%s&country=%s&ngsw-bypass=%s' % (self.id, monthYear, country, ngsw_bypass)) return data + def get_consumption_details(self, monthYear, ngsw_bypass=True): + """ + Get energy consumption details of your home by month and year + + Parameters: + monthYear (str): Month and year of the range date. e.g. "2022-09". + ngsw_bypass (bool): Bypass the ngsw cache. + + Returns: + isInPreferredUnit (bool): Is in preferred unit + summary (dict): Summary + graphConsumption (dict): Graph consumption + consumptionComparison (dict): Consumption comparison + heatingHotWaterSplit (dict): Heating hotwater split + roomBreakdown (dict): Room breakdown + heatingInsights (dict): Heating insights + showAddData (bool): Show add data + + + ??? info "Result example" + ```json + { + "isInPreferredUnit": true, + "summary": { + "costInCents": 12618.34, + "costForecastInCents": null, + "averageDailyCostInCents": 407.04322580645163, + "consumption": 115.449, + "consumptionForecast": null, + "averageDailyConsumption": 3.7241612903225807, + "unit": "m3", + "tariff": { + "unit": "kWh", + "unitPriceInCents": 10.36 + } + }, + "graphConsumption": { + "unit": "m3", + "monthlyAggregation": { + "endOfMonthForecast": null, + "requestedMonth": { + "startDate": "2024-12-01", + "endDate": "2024-12-31", + "hasDomesticHotWater": false, + "totalConsumption": 115.449, + "totalCostInCents": 12618.34, + "consumptionPerDate": [ + { + "date": "2024-12-01", + "consumption": 3.721, + "costInCents": 406.7, + "hotWater": null, + "heating": 3.721, + "hasData": true + }, + [...] // 29 more days + ] + }, + "monthBefore": { + "startDate": "2024-11-01", + "endDate": "2024-11-30", + "hasDomesticHotWater": false, + "totalConsumption": 82.69, + "totalCostInCents": 9037.85, + "consumptionPerDate": [ + { + "date": "2024-11-01", + "consumption": 1.471, + "costInCents": 160.78, + "hotWater": null, + "heating": 1.471, + "hasData": true + }, + [...] // 29 more days + ] + }, + "yearBefore": { + "startDate": "2023-12-01", + "endDate": "2023-12-31", + "hasDomesticHotWater": false, + "totalConsumption": 105.242, + "totalCostInCents": 11502.74, + "consumptionPerDate": [ + { + "date": "2023-12-01", + "consumption": 7.89, + "costInCents": 862.36, + "hotWater": null, + "heating": 7.89, + "hasData": true + }, + [...] // 29 more days + ] + } + } + }, + "consumptionComparison": { + "consumption": { + "comparedToMonthBefore": { + "percentage": 40, + "trend": "INCREASE", + "requestedMonth": "2024-12", + "comparedToMonth": "2024-11" + }, + "comparedToYearBefore": { + "percentage": 10, + "trend": "INCREASE", + "requestedMonth": "2024-12", + "comparedToMonth": "2023-12" + } + }, + "cost": { + "comparedToMonthBefore": { + "percentage": 40, + "trend": "INCREASE", + "requestedMonth": "2024-12", + "comparedToMonth": "2024-11" + }, + "comparedToYearBefore": { + "percentage": 10, + "trend": "INCREASE", + "requestedMonth": "2024-12", + "comparedToMonth": "2023-12" + } + } + }, + "heatingHotWaterSplit": null, + "roomBreakdown": { + "unit": "m3", + "requestedMonth": { + "perRoom": [ + { + "id": 1, + "name": "Maison", + "consumption": 45.772999999999996, + "costInCents": 5002.9 + }, + ... + ], + "startDate": "2024-12-01", + "endDate": "2024-12-31" + }, + "yearBefore": { + "perRoom": [ + { + "id": 1, + "name": "Maison", + "consumption": 39.895, + "costInCents": 4360.44 + }, + ... + ], + "startDate": "2023-12-01", + "endDate": "2023-12-31" + } + }, + "heatingInsights": { + "heatingHours": { + "diff": 54, + "trend": "INCREASE", + "comparedTo": "2023-12" + }, + "outsideTemperature": { + "diff": 1, + "trend": "DECREASE", + "comparedTo": "2023-12" + }, + "awayHours": { + "diff": 25, + "trend": "DECREASE", + "comparedTo": "2023-12" + } + }, + "showAddData": true + } + ``` + """ + + data = self._api_energy_insights_call('homes/%i/consumptionDetails?month=%s&ngsw-bypass=%s' % (self.id, monthYear, ngsw_bypass)) + return data + def get_energy_settings(self, ngsw_bypass=True): """ Get energy settings of your home diff --git a/schemas/get_away_configuration.json b/schemas/get_away_configuration.json index 48fc47a..5e9cde1 100644 --- a/schemas/get_away_configuration.json +++ b/schemas/get_away_configuration.json @@ -1,4 +1,32 @@ { "$schema": "http://json-schema.org/schema#", - "type": "null" + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "preheatingLevel": { + "type": "string" + }, + "minimumAwayTemperature": { + "type": "object", + "properties": { + "celsius": { + "type": "number" + }, + "fahrenheit": { + "type": "number" + } + }, + "required": [ + "celsius", + "fahrenheit" + ] + } + }, + "required": [ + "minimumAwayTemperature", + "preheatingLevel", + "type" + ] } \ No newline at end of file diff --git a/schemas/get_consumption_details.json b/schemas/get_consumption_details.json new file mode 100644 index 0000000..211090e --- /dev/null +++ b/schemas/get_consumption_details.json @@ -0,0 +1,622 @@ +{ + "$schema": "http://json-schema.org/schema#", + "type": "object", + "properties": { + "isInPreferredUnit": { + "type": "boolean" + }, + "summary": { + "type": "object", + "properties": { + "costInCents": { + "type": "number" + }, + "costForecastInCents": { + "type": "number" + }, + "averageDailyCostInCents": { + "type": "number" + }, + "consumption": { + "type": "number" + }, + "consumptionForecast": { + "type": "number" + }, + "averageDailyConsumption": { + "type": "number" + }, + "unit": { + "type": "string" + }, + "tariff": { + "type": "object", + "properties": { + "unit": { + "type": "string" + }, + "unitPriceInCents": { + "type": "number" + } + }, + "required": [ + "unit", + "unitPriceInCents" + ] + } + }, + "required": [ + "averageDailyConsumption", + "averageDailyCostInCents", + "consumption", + "consumptionForecast", + "costForecastInCents", + "costInCents", + "tariff", + "unit" + ] + }, + "graphConsumption": { + "type": "object", + "properties": { + "unit": { + "type": "string" + }, + "monthlyAggregation": { + "type": "object", + "properties": { + "endOfMonthForecast": { + "type": "object", + "properties": { + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "totalConsumption": { + "type": "number" + }, + "totalCostInCents": { + "type": "number" + }, + "hasDomesticHotWater": { + "type": "boolean" + }, + "consumptionPerDate": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "consumption": { + "type": "number" + }, + "costInCents": { + "type": "number" + }, + "hasData": { + "type": "boolean" + } + }, + "required": [ + "consumption", + "costInCents", + "date", + "hasData" + ] + } + } + }, + "required": [ + "consumptionPerDate", + "endDate", + "hasDomesticHotWater", + "startDate", + "totalConsumption", + "totalCostInCents" + ] + }, + "requestedMonth": { + "type": "object", + "properties": { + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "hasDomesticHotWater": { + "type": "boolean" + }, + "totalConsumption": { + "type": "number" + }, + "totalCostInCents": { + "type": "number" + }, + "consumptionPerDate": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "consumption": { + "type": "number" + }, + "costInCents": { + "type": "number" + }, + "hotWater": { + "type": "null" + }, + "heating": { + "type": "number" + }, + "hasData": { + "type": "boolean" + } + }, + "required": [ + "consumption", + "costInCents", + "date", + "hasData", + "heating", + "hotWater" + ] + } + } + }, + "required": [ + "consumptionPerDate", + "endDate", + "hasDomesticHotWater", + "startDate", + "totalConsumption", + "totalCostInCents" + ] + }, + "monthBefore": { + "type": "object", + "properties": { + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "hasDomesticHotWater": { + "type": "boolean" + }, + "totalConsumption": { + "type": "number" + }, + "totalCostInCents": { + "type": "number" + }, + "consumptionPerDate": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "consumption": { + "type": "number" + }, + "costInCents": { + "type": "number" + }, + "hotWater": { + "type": "null" + }, + "heating": { + "type": "number" + }, + "hasData": { + "type": "boolean" + } + }, + "required": [ + "consumption", + "costInCents", + "date", + "hasData", + "heating", + "hotWater" + ] + } + } + }, + "required": [ + "consumptionPerDate", + "endDate", + "hasDomesticHotWater", + "startDate", + "totalConsumption", + "totalCostInCents" + ] + }, + "yearBefore": { + "type": "object", + "properties": { + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + }, + "hasDomesticHotWater": { + "type": "boolean" + }, + "totalConsumption": { + "type": "number" + }, + "totalCostInCents": { + "type": "number" + }, + "consumptionPerDate": { + "type": "array", + "items": { + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "consumption": { + "type": "number" + }, + "costInCents": { + "type": "number" + }, + "hotWater": { + "type": "null" + }, + "heating": { + "type": "number" + }, + "hasData": { + "type": "boolean" + } + }, + "required": [ + "consumption", + "costInCents", + "date", + "hasData", + "heating", + "hotWater" + ] + } + } + }, + "required": [ + "consumptionPerDate", + "endDate", + "hasDomesticHotWater", + "startDate", + "totalConsumption", + "totalCostInCents" + ] + } + }, + "required": [ + "endOfMonthForecast", + "monthBefore", + "requestedMonth", + "yearBefore" + ] + } + }, + "required": [ + "monthlyAggregation", + "unit" + ] + }, + "consumptionComparison": { + "type": "object", + "properties": { + "consumption": { + "type": "object", + "properties": { + "comparedToMonthBefore": { + "type": "object", + "properties": { + "percentage": { + "type": "integer" + }, + "trend": { + "type": "string" + }, + "requestedMonth": { + "type": "string" + }, + "comparedToMonth": { + "type": "string" + } + }, + "required": [ + "comparedToMonth", + "percentage", + "requestedMonth", + "trend" + ] + }, + "comparedToYearBefore": { + "type": "object", + "properties": { + "percentage": { + "type": "integer" + }, + "trend": { + "type": "string" + }, + "requestedMonth": { + "type": "string" + }, + "comparedToMonth": { + "type": "string" + } + }, + "required": [ + "comparedToMonth", + "percentage", + "requestedMonth", + "trend" + ] + } + }, + "required": [ + "comparedToMonthBefore", + "comparedToYearBefore" + ] + }, + "cost": { + "type": "object", + "properties": { + "comparedToMonthBefore": { + "type": "object", + "properties": { + "percentage": { + "type": "integer" + }, + "trend": { + "type": "string" + }, + "requestedMonth": { + "type": "string" + }, + "comparedToMonth": { + "type": "string" + } + }, + "required": [ + "comparedToMonth", + "percentage", + "requestedMonth", + "trend" + ] + }, + "comparedToYearBefore": { + "type": "object", + "properties": { + "percentage": { + "type": "integer" + }, + "trend": { + "type": "string" + }, + "requestedMonth": { + "type": "string" + }, + "comparedToMonth": { + "type": "string" + } + }, + "required": [ + "comparedToMonth", + "percentage", + "requestedMonth", + "trend" + ] + } + }, + "required": [ + "comparedToMonthBefore", + "comparedToYearBefore" + ] + } + }, + "required": [ + "consumption", + "cost" + ] + }, + "heatingHotWaterSplit": { + "type": "null" + }, + "roomBreakdown": { + "type": "object", + "properties": { + "unit": { + "type": "string" + }, + "requestedMonth": { + "type": "object", + "properties": { + "perRoom": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "consumption": { + "type": "number" + }, + "costInCents": { + "type": "number" + } + }, + "required": [ + "consumption", + "costInCents", + "id", + "name" + ] + } + }, + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + } + }, + "required": [ + "endDate", + "perRoom", + "startDate" + ] + }, + "yearBefore": { + "type": "object", + "properties": { + "perRoom": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "consumption": { + "type": "number" + }, + "costInCents": { + "type": "number" + } + }, + "required": [ + "consumption", + "costInCents", + "id", + "name" + ] + } + }, + "startDate": { + "type": "string" + }, + "endDate": { + "type": "string" + } + }, + "required": [ + "endDate", + "perRoom", + "startDate" + ] + } + }, + "required": [ + "requestedMonth", + "unit", + "yearBefore" + ] + }, + "heatingInsights": { + "type": "object", + "properties": { + "heatingHours": { + "type": "object", + "properties": { + "diff": { + "type": "integer" + }, + "trend": { + "type": "string" + }, + "comparedTo": { + "type": "string" + } + }, + "required": [ + "comparedTo", + "diff", + "trend" + ] + }, + "outsideTemperature": { + "type": "object", + "properties": { + "diff": { + "type": "integer" + }, + "trend": { + "type": "string" + }, + "comparedTo": { + "type": "string" + } + }, + "required": [ + "comparedTo", + "diff", + "trend" + ] + }, + "awayHours": { + "type": "object", + "properties": { + "diff": { + "type": "integer" + }, + "trend": { + "type": "string" + }, + "comparedTo": { + "type": "string" + } + }, + "required": [ + "comparedTo", + "diff", + "trend" + ] + } + }, + "required": [ + "awayHours", + "heatingHours", + "outsideTemperature" + ] + }, + "showAddData": { + "type": "boolean" + } + }, + "required": [ + "consumptionComparison", + "graphConsumption", + "heatingHotWaterSplit", + "heatingInsights", + "isInPreferredUnit", + "roomBreakdown", + "showAddData", + "summary" + ] +} \ No newline at end of file diff --git a/schemas/get_measuring_device.json b/schemas/get_measuring_device.json index 48fc47a..9ced482 100644 --- a/schemas/get_measuring_device.json +++ b/schemas/get_measuring_device.json @@ -1,4 +1,59 @@ { "$schema": "http://json-schema.org/schema#", - "type": "null" + "type": "object", + "properties": { + "deviceType": { + "type": "string" + }, + "serialNo": { + "type": "string" + }, + "shortSerialNo": { + "type": "string" + }, + "currentFwVersion": { + "type": "string" + }, + "connectionState": { + "type": "object", + "properties": { + "value": { + "type": "boolean" + }, + "timestamp": { + "type": "string" + } + }, + "required": [ + "timestamp", + "value" + ] + }, + "characteristics": { + "type": "object", + "properties": { + "capabilities": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "capabilities" + ] + }, + "batteryState": { + "type": "string" + } + }, + "required": [ + "batteryState", + "characteristics", + "connectionState", + "currentFwVersion", + "deviceType", + "serialNo", + "shortSerialNo" + ] } \ No newline at end of file diff --git a/schemas/get_measuring_devices.json b/schemas/get_measuring_devices.json index 48fc47a..1a8fd71 100644 --- a/schemas/get_measuring_devices.json +++ b/schemas/get_measuring_devices.json @@ -1,4 +1,4 @@ { "$schema": "http://json-schema.org/schema#", "type": "null" -} \ No newline at end of file +} diff --git a/schemas/get_zone_states.json b/schemas/get_zone_states.json index bdb0322..49af517 100644 --- a/schemas/get_zone_states.json +++ b/schemas/get_zone_states.json @@ -287,82 +287,10 @@ ] }, "overlayType": { - "type": "string" + "type": "null" }, "overlay": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "setting": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "power": { - "type": "string" - }, - "temperature": { - "type": "object", - "properties": { - "celsius": { - "type": "number" - }, - "fahrenheit": { - "type": "number" - } - }, - "required": [ - "celsius", - "fahrenheit" - ] - } - }, - "required": [ - "power", - "temperature", - "type" - ] - }, - "termination": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "typeSkillBasedApp": { - "type": "string" - }, - "durationInSeconds": { - "type": "integer" - }, - "expiry": { - "type": "string" - }, - "remainingTimeInSeconds": { - "type": "integer" - }, - "projectedExpiry": { - "type": "string" - } - }, - "required": [ - "durationInSeconds", - "expiry", - "projectedExpiry", - "remainingTimeInSeconds", - "type", - "typeSkillBasedApp" - ] - } - }, - "required": [ - "setting", - "termination", - "type" - ] + "type": "null" }, "openWindow": { "type": "null" diff --git a/tests/api/utils.py b/tests/api/utils.py index a433a61..1f3aaa9 100644 --- a/tests/api/utils.py +++ b/tests/api/utils.py @@ -173,6 +173,11 @@ def get_consumption_overview(): response = tado.get_consumption_overview(monthYear=monthYear, country=country) return response + def get_consumption_details(): + monthYear = date.today().strftime("%Y-%m") + response = tado.get_consumption_details(monthYear=monthYear) + return response + def get_energy_settings(): response = tado.get_energy_settings() return response