From bcfef44caa9fe73b22d0e2ed3bfa0628a61c18b0 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 11 Aug 2023 16:48:23 +0200 Subject: [PATCH] update service generation --- android/app/version.properties | 4 +- lib/Screens/Main/Home/roomDetailPage.dart | 2 +- lib/api/swagger.yaml | 23 +++++- mycore_api/.openapi-generator/FILES | 7 -- mycore_api/README.md | 2 +- mycore_api/doc/AlarmApi.md | 2 +- mycore_api/doc/AuthenticationApi.md | 2 +- mycore_api/doc/AutomationApi.md | 2 +- mycore_api/doc/AzureApi.md | 2 +- mycore_api/doc/BooksApi.md | 2 +- mycore_api/doc/DeviceApi.md | 2 +- mycore_api/doc/DeviceDetailDTO.md | 4 + mycore_api/doc/DeviceDetailDTOAllOf.md | 4 + mycore_api/doc/EnergyApi.md | 2 +- mycore_api/doc/EventApi.md | 2 +- mycore_api/doc/FacebookApi.md | 2 +- mycore_api/doc/GoogleApi.md | 2 +- mycore_api/doc/GroupApi.md | 2 +- mycore_api/doc/HomeApi.md | 2 +- mycore_api/doc/IOTApi.md | 2 +- mycore_api/doc/LayoutApi.md | 2 +- mycore_api/doc/MQTTApi.md | 2 +- mycore_api/doc/NotificationApi.md | 2 +- mycore_api/doc/OddApi.md | 2 +- mycore_api/doc/ProviderApi.md | 2 +- mycore_api/doc/ProviderDTO.md | 3 + mycore_api/doc/RoomApi.md | 2 +- mycore_api/doc/ScreenDeviceApi.md | 2 +- mycore_api/doc/TokenApi.md | 2 +- mycore_api/doc/TwitterApi.md | 2 +- mycore_api/doc/UserApi.md | 2 +- mycore_api/doc/ValuesApi.md | 2 +- mycore_api/lib/api_client.dart | 2 +- mycore_api/lib/model/device_detail_dto.dart | 74 ++++++++++++++++++- .../lib/model/device_detail_dto_all_of.dart | 74 ++++++++++++++++++- mycore_api/lib/model/provider_dto.dart | 39 +++++++++- mycore_api/lib/model/provider_type.dart | 3 + 37 files changed, 243 insertions(+), 46 deletions(-) diff --git a/android/app/version.properties b/android/app/version.properties index 19dae9d..828b41b 100644 --- a/android/app/version.properties +++ b/android/app/version.properties @@ -1,5 +1,5 @@ -#Fri Aug 04 18:34:37 CEST 2023 -VERSION_BUILD=69 +#Fri Aug 11 16:46:29 CEST 2023 +VERSION_BUILD=72 VERSION_MAJOR=1 VERSION_MINOR=0 VERSION_PATCH=0 diff --git a/lib/Screens/Main/Home/roomDetailPage.dart b/lib/Screens/Main/Home/roomDetailPage.dart index 02dd9b6..3b921d1 100644 --- a/lib/Screens/Main/Home/roomDetailPage.dart +++ b/lib/Screens/Main/Home/roomDetailPage.dart @@ -101,7 +101,7 @@ class _RoomDetailPageState extends State { //if(roomDetailDTO.devices![index].meansOfCommunications!.contains(API.MeansOfCommunication.zigbee)) { switch(roomDetailDTO.devices![index].type) { case DeviceType.light: - case DeviceType.plug: + case DeviceType.switch_: debugPrint("Quick action supported !"); List? statesToSend = []; statesToSend.add(AutomationState(name: "state", value: "toggle")); diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index 48865cf..9be51e2 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -5,7 +5,7 @@ info: description: API description version: Version Pre-Alpha servers: - - url: http://localhost:25049 + - url: https://localhost:5001 paths: /api/books: get: @@ -3906,6 +3906,16 @@ components: linkQuality: type: integer format: int32 + isCO2: + type: boolean + cO2: + type: integer + format: int32 + isNoise: + type: boolean + noise: + type: integer + format: int32 MeansOfCommunication: type: string description: '' @@ -4101,6 +4111,9 @@ components: homeId: type: string nullable: true + serviceHomeId: + type: string + nullable: true endpoint: type: string nullable: true @@ -4115,6 +4128,12 @@ components: nullable: true active: type: boolean + value: + type: string + nullable: true + valueRefresh: + type: string + nullable: true ProviderType: type: string description: '' @@ -4123,11 +4142,13 @@ components: - meross - yeelight - zigbee2mqtt + - netatmo enum: - arlo - meross - yeelight - zigbee2mqtt + - netatmo ScreenDevice: type: object additionalProperties: false diff --git a/mycore_api/.openapi-generator/FILES b/mycore_api/.openapi-generator/FILES index b2d973c..ae1ae31 100644 --- a/mycore_api/.openapi-generator/FILES +++ b/mycore_api/.openapi-generator/FILES @@ -237,10 +237,3 @@ lib/model/user_info.dart lib/model/user_info_detail_dto.dart lib/model/view_by.dart pubspec.yaml -test/alarm_mode_detail_dto_all_of_geolocalized_mode_test.dart -test/alarm_mode_detail_dto_all_of_programmed_mode_test.dart -test/event_detail_dto_all_of_alarm_triggered_test.dart -test/event_detail_dto_all_of_automation_triggered_test.dart -test/event_detail_dto_all_of_device_state_test.dart -test/notification_api_test.dart -test/notification_dto_test.dart diff --git a/mycore_api/README.md b/mycore_api/README.md index d57167c..bbf3586 100644 --- a/mycore_api/README.md +++ b/mycore_api/README.md @@ -56,7 +56,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/mycore_api/doc/AlarmApi.md b/mycore_api/doc/AlarmApi.md index ea70350..1d0769d 100644 --- a/mycore_api/doc/AlarmApi.md +++ b/mycore_api/doc/AlarmApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/AuthenticationApi.md b/mycore_api/doc/AuthenticationApi.md index d713be5..be0a849 100644 --- a/mycore_api/doc/AuthenticationApi.md +++ b/mycore_api/doc/AuthenticationApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/AutomationApi.md b/mycore_api/doc/AutomationApi.md index ca18ed2..dfc9705 100644 --- a/mycore_api/doc/AutomationApi.md +++ b/mycore_api/doc/AutomationApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/AzureApi.md b/mycore_api/doc/AzureApi.md index 46985fc..cafd7ed 100644 --- a/mycore_api/doc/AzureApi.md +++ b/mycore_api/doc/AzureApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/BooksApi.md b/mycore_api/doc/BooksApi.md index 4ee5b60..5ea0616 100644 --- a/mycore_api/doc/BooksApi.md +++ b/mycore_api/doc/BooksApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/DeviceApi.md b/mycore_api/doc/DeviceApi.md index b225513..2e576f0 100644 --- a/mycore_api/doc/DeviceApi.md +++ b/mycore_api/doc/DeviceApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/DeviceDetailDTO.md b/mycore_api/doc/DeviceDetailDTO.md index 937c269..98a73d7 100644 --- a/mycore_api/doc/DeviceDetailDTO.md +++ b/mycore_api/doc/DeviceDetailDTO.md @@ -82,6 +82,10 @@ Name | Type | Description | Notes **voltage** | **num** | | [optional] **isLinkQuality** | **bool** | | [optional] **linkQuality** | **int** | | [optional] +**isCO2** | **bool** | | [optional] +**cO2** | **int** | | [optional] +**isNoise** | **bool** | | [optional] +**noise** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/mycore_api/doc/DeviceDetailDTOAllOf.md b/mycore_api/doc/DeviceDetailDTOAllOf.md index 94b6fa1..b4079e0 100644 --- a/mycore_api/doc/DeviceDetailDTOAllOf.md +++ b/mycore_api/doc/DeviceDetailDTOAllOf.md @@ -67,6 +67,10 @@ Name | Type | Description | Notes **voltage** | **num** | | [optional] **isLinkQuality** | **bool** | | [optional] **linkQuality** | **int** | | [optional] +**isCO2** | **bool** | | [optional] +**cO2** | **int** | | [optional] +**isNoise** | **bool** | | [optional] +**noise** | **int** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/mycore_api/doc/EnergyApi.md b/mycore_api/doc/EnergyApi.md index 8f394ad..324cf1a 100644 --- a/mycore_api/doc/EnergyApi.md +++ b/mycore_api/doc/EnergyApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/EventApi.md b/mycore_api/doc/EventApi.md index 6aae683..b79cb0a 100644 --- a/mycore_api/doc/EventApi.md +++ b/mycore_api/doc/EventApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/FacebookApi.md b/mycore_api/doc/FacebookApi.md index 2688f29..bb9357c 100644 --- a/mycore_api/doc/FacebookApi.md +++ b/mycore_api/doc/FacebookApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/GoogleApi.md b/mycore_api/doc/GoogleApi.md index 27d3ab8..38ea95d 100644 --- a/mycore_api/doc/GoogleApi.md +++ b/mycore_api/doc/GoogleApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/GroupApi.md b/mycore_api/doc/GroupApi.md index 565afa7..c302d1b 100644 --- a/mycore_api/doc/GroupApi.md +++ b/mycore_api/doc/GroupApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/HomeApi.md b/mycore_api/doc/HomeApi.md index 8f3bdd8..2c75214 100644 --- a/mycore_api/doc/HomeApi.md +++ b/mycore_api/doc/HomeApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/IOTApi.md b/mycore_api/doc/IOTApi.md index 1389827..0bae2f8 100644 --- a/mycore_api/doc/IOTApi.md +++ b/mycore_api/doc/IOTApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/LayoutApi.md b/mycore_api/doc/LayoutApi.md index 7bb600f..f527bf1 100644 --- a/mycore_api/doc/LayoutApi.md +++ b/mycore_api/doc/LayoutApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/MQTTApi.md b/mycore_api/doc/MQTTApi.md index ac6e3ec..550dcce 100644 --- a/mycore_api/doc/MQTTApi.md +++ b/mycore_api/doc/MQTTApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/NotificationApi.md b/mycore_api/doc/NotificationApi.md index 0e9d63e..5063869 100644 --- a/mycore_api/doc/NotificationApi.md +++ b/mycore_api/doc/NotificationApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/OddApi.md b/mycore_api/doc/OddApi.md index 6be8b61..08e5dd2 100644 --- a/mycore_api/doc/OddApi.md +++ b/mycore_api/doc/OddApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/ProviderApi.md b/mycore_api/doc/ProviderApi.md index 8591422..7de195e 100644 --- a/mycore_api/doc/ProviderApi.md +++ b/mycore_api/doc/ProviderApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/ProviderDTO.md b/mycore_api/doc/ProviderDTO.md index a3fbfb3..bb769cf 100644 --- a/mycore_api/doc/ProviderDTO.md +++ b/mycore_api/doc/ProviderDTO.md @@ -12,11 +12,14 @@ Name | Type | Description | Notes **name** | **String** | | [optional] **type** | [**ProviderType**](ProviderType.md) | | [optional] **homeId** | **String** | | [optional] +**serviceHomeId** | **String** | | [optional] **endpoint** | **String** | | [optional] **username** | **String** | | [optional] **password** | **String** | | [optional] **apiKey** | **String** | | [optional] **active** | **bool** | | [optional] +**value** | **String** | | [optional] +**valueRefresh** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/mycore_api/doc/RoomApi.md b/mycore_api/doc/RoomApi.md index 13c5d14..ab53924 100644 --- a/mycore_api/doc/RoomApi.md +++ b/mycore_api/doc/RoomApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/ScreenDeviceApi.md b/mycore_api/doc/ScreenDeviceApi.md index 20e8403..c82f5d0 100644 --- a/mycore_api/doc/ScreenDeviceApi.md +++ b/mycore_api/doc/ScreenDeviceApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/TokenApi.md b/mycore_api/doc/TokenApi.md index 56bf7f3..802b2e8 100644 --- a/mycore_api/doc/TokenApi.md +++ b/mycore_api/doc/TokenApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/TwitterApi.md b/mycore_api/doc/TwitterApi.md index 3de11d6..f3ebd05 100644 --- a/mycore_api/doc/TwitterApi.md +++ b/mycore_api/doc/TwitterApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/UserApi.md b/mycore_api/doc/UserApi.md index 1de6320..aee7b40 100644 --- a/mycore_api/doc/UserApi.md +++ b/mycore_api/doc/UserApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/doc/ValuesApi.md b/mycore_api/doc/ValuesApi.md index 60e9921..2e1de6d 100644 --- a/mycore_api/doc/ValuesApi.md +++ b/mycore_api/doc/ValuesApi.md @@ -5,7 +5,7 @@ import 'package:mycore_api/api.dart'; ``` -All URIs are relative to *http://localhost:25049* +All URIs are relative to *https://localhost:5001* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/mycore_api/lib/api_client.dart b/mycore_api/lib/api_client.dart index ac9567e..f432ad9 100644 --- a/mycore_api/lib/api_client.dart +++ b/mycore_api/lib/api_client.dart @@ -11,7 +11,7 @@ part of openapi.api; class ApiClient { - ApiClient({this.basePath = 'http://localhost:25049', this.authentication,}); + ApiClient({this.basePath = 'https://localhost:5001', this.authentication,}); final String basePath; final Authentication? authentication; diff --git a/mycore_api/lib/model/device_detail_dto.dart b/mycore_api/lib/model/device_detail_dto.dart index f2d572f..a57734a 100644 --- a/mycore_api/lib/model/device_detail_dto.dart +++ b/mycore_api/lib/model/device_detail_dto.dart @@ -87,6 +87,10 @@ class DeviceDetailDTO { this.voltage, this.isLinkQuality, this.linkQuality, + this.isCO2, + this.cO2, + this.isNoise, + this.noise, }); String? id; @@ -525,6 +529,38 @@ class DeviceDetailDTO { /// int? linkQuality; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isCO2; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? cO2; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isNoise; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? noise; + @override bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && other.id == id && @@ -600,7 +636,11 @@ class DeviceDetailDTO { other.isVoltage == isVoltage && other.voltage == voltage && other.isLinkQuality == isLinkQuality && - other.linkQuality == linkQuality; + other.linkQuality == linkQuality && + other.isCO2 == isCO2 && + other.cO2 == cO2 && + other.isNoise == isNoise && + other.noise == noise; @override int get hashCode => @@ -678,10 +718,14 @@ class DeviceDetailDTO { (isVoltage == null ? 0 : isVoltage!.hashCode) + (voltage == null ? 0 : voltage!.hashCode) + (isLinkQuality == null ? 0 : isLinkQuality!.hashCode) + - (linkQuality == null ? 0 : linkQuality!.hashCode); + (linkQuality == null ? 0 : linkQuality!.hashCode) + + (isCO2 == null ? 0 : isCO2!.hashCode) + + (cO2 == null ? 0 : cO2!.hashCode) + + (isNoise == null ? 0 : isNoise!.hashCode) + + (noise == null ? 0 : noise!.hashCode); @override - String toString() => 'DeviceDetailDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, lastMessageDate=$lastMessageDate, battery=$battery, batteryStatus=$batteryStatus, firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastMessage=$lastMessage, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations, isContact=$isContact, contact=$contact, isIlluminance=$isIlluminance, illuminance=$illuminance, isBrightness=$isBrightness, brightness=$brightness, isState=$isState, state=$state, isColorTemp=$isColorTemp, colorTemp=$colorTemp, isColorXY=$isColorXY, colorX=$colorX, colorY=$colorY, isOccupation=$isOccupation, occupation=$occupation, isAlarm=$isAlarm, alarm=$alarm, isWaterLeak=$isWaterLeak, waterLeak=$waterLeak, isSmoke=$isSmoke, smoke=$smoke, isVibration=$isVibration, vibration=$vibration, isAction=$isAction, action=$action, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isPressure=$isPressure, pressure=$pressure, isAirQuality=$isAirQuality, airQuality=$airQuality, isFanSpeed=$isFanSpeed, fanSpeed=$fanSpeed, isFanMode=$isFanMode, fanMode=$fanMode, isConsumption=$isConsumption, consumption=$consumption, isCurrentPower=$isCurrentPower, currentPower=$currentPower, isVoltage=$isVoltage, voltage=$voltage, isLinkQuality=$isLinkQuality, linkQuality=$linkQuality]'; + String toString() => 'DeviceDetailDTO[id=$id, homeId=$homeId, description=$description, name=$name, model=$model, type=$type, status=$status, connectionStatus=$connectionStatus, roomId=$roomId, providerId=$providerId, providerName=$providerName, lastStateDate=$lastStateDate, lastMessageDate=$lastMessageDate, battery=$battery, batteryStatus=$batteryStatus, firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastMessage=$lastMessage, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations, isContact=$isContact, contact=$contact, isIlluminance=$isIlluminance, illuminance=$illuminance, isBrightness=$isBrightness, brightness=$brightness, isState=$isState, state=$state, isColorTemp=$isColorTemp, colorTemp=$colorTemp, isColorXY=$isColorXY, colorX=$colorX, colorY=$colorY, isOccupation=$isOccupation, occupation=$occupation, isAlarm=$isAlarm, alarm=$alarm, isWaterLeak=$isWaterLeak, waterLeak=$waterLeak, isSmoke=$isSmoke, smoke=$smoke, isVibration=$isVibration, vibration=$vibration, isAction=$isAction, action=$action, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isPressure=$isPressure, pressure=$pressure, isAirQuality=$isAirQuality, airQuality=$airQuality, isFanSpeed=$isFanSpeed, fanSpeed=$fanSpeed, isFanMode=$isFanMode, fanMode=$fanMode, isConsumption=$isConsumption, consumption=$consumption, isCurrentPower=$isCurrentPower, currentPower=$currentPower, isVoltage=$isVoltage, voltage=$voltage, isLinkQuality=$isLinkQuality, linkQuality=$linkQuality, isCO2=$isCO2, cO2=$cO2, isNoise=$isNoise, noise=$noise]'; Map toJson() { final json = {}; @@ -1055,6 +1099,26 @@ class DeviceDetailDTO { } else { json[r'linkQuality'] = null; } + if (this.isCO2 != null) { + json[r'isCO2'] = this.isCO2; + } else { + json[r'isCO2'] = null; + } + if (this.cO2 != null) { + json[r'cO2'] = this.cO2; + } else { + json[r'cO2'] = null; + } + if (this.isNoise != null) { + json[r'isNoise'] = this.isNoise; + } else { + json[r'isNoise'] = null; + } + if (this.noise != null) { + json[r'noise'] = this.noise; + } else { + json[r'noise'] = null; + } return json; } @@ -1167,6 +1231,10 @@ class DeviceDetailDTO { : num.parse(json[r'voltage'].toString()), isLinkQuality: mapValueOfType(json, r'isLinkQuality'), linkQuality: mapValueOfType(json, r'linkQuality'), + isCO2: mapValueOfType(json, r'isCO2'), + cO2: mapValueOfType(json, r'cO2'), + isNoise: mapValueOfType(json, r'isNoise'), + noise: mapValueOfType(json, r'noise'), ); } return null; diff --git a/mycore_api/lib/model/device_detail_dto_all_of.dart b/mycore_api/lib/model/device_detail_dto_all_of.dart index 0469d75..0be3220 100644 --- a/mycore_api/lib/model/device_detail_dto_all_of.dart +++ b/mycore_api/lib/model/device_detail_dto_all_of.dart @@ -72,6 +72,10 @@ class DeviceDetailDTOAllOf { this.voltage, this.isLinkQuality, this.linkQuality, + this.isCO2, + this.cO2, + this.isNoise, + this.noise, }); String? firmwareVersion; @@ -438,6 +442,38 @@ class DeviceDetailDTOAllOf { /// int? linkQuality; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isCO2; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? cO2; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isNoise; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? noise; + @override bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTOAllOf && other.firmwareVersion == firmwareVersion && @@ -498,7 +534,11 @@ class DeviceDetailDTOAllOf { other.isVoltage == isVoltage && other.voltage == voltage && other.isLinkQuality == isLinkQuality && - other.linkQuality == linkQuality; + other.linkQuality == linkQuality && + other.isCO2 == isCO2 && + other.cO2 == cO2 && + other.isNoise == isNoise && + other.noise == noise; @override int get hashCode => @@ -561,10 +601,14 @@ class DeviceDetailDTOAllOf { (isVoltage == null ? 0 : isVoltage!.hashCode) + (voltage == null ? 0 : voltage!.hashCode) + (isLinkQuality == null ? 0 : isLinkQuality!.hashCode) + - (linkQuality == null ? 0 : linkQuality!.hashCode); + (linkQuality == null ? 0 : linkQuality!.hashCode) + + (isCO2 == null ? 0 : isCO2!.hashCode) + + (cO2 == null ? 0 : cO2!.hashCode) + + (isNoise == null ? 0 : isNoise!.hashCode) + + (noise == null ? 0 : noise!.hashCode); @override - String toString() => 'DeviceDetailDTOAllOf[firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastMessage=$lastMessage, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations, isContact=$isContact, contact=$contact, isIlluminance=$isIlluminance, illuminance=$illuminance, isBrightness=$isBrightness, brightness=$brightness, isState=$isState, state=$state, isColorTemp=$isColorTemp, colorTemp=$colorTemp, isColorXY=$isColorXY, colorX=$colorX, colorY=$colorY, isOccupation=$isOccupation, occupation=$occupation, isAlarm=$isAlarm, alarm=$alarm, isWaterLeak=$isWaterLeak, waterLeak=$waterLeak, isSmoke=$isSmoke, smoke=$smoke, isVibration=$isVibration, vibration=$vibration, isAction=$isAction, action=$action, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isPressure=$isPressure, pressure=$pressure, isAirQuality=$isAirQuality, airQuality=$airQuality, isFanSpeed=$isFanSpeed, fanSpeed=$fanSpeed, isFanMode=$isFanMode, fanMode=$fanMode, isConsumption=$isConsumption, consumption=$consumption, isCurrentPower=$isCurrentPower, currentPower=$currentPower, isVoltage=$isVoltage, voltage=$voltage, isLinkQuality=$isLinkQuality, linkQuality=$linkQuality]'; + String toString() => 'DeviceDetailDTOAllOf[firmwareVersion=$firmwareVersion, hardwareVersion=$hardwareVersion, port=$port, meansOfCommunications=$meansOfCommunications, createdDate=$createdDate, updatedDate=$updatedDate, lastMessage=$lastMessage, lastState=$lastState, ipAddress=$ipAddress, serviceIdentification=$serviceIdentification, manufacturerName=$manufacturerName, groupIds=$groupIds, properties=$properties, supportedOperations=$supportedOperations, isContact=$isContact, contact=$contact, isIlluminance=$isIlluminance, illuminance=$illuminance, isBrightness=$isBrightness, brightness=$brightness, isState=$isState, state=$state, isColorTemp=$isColorTemp, colorTemp=$colorTemp, isColorXY=$isColorXY, colorX=$colorX, colorY=$colorY, isOccupation=$isOccupation, occupation=$occupation, isAlarm=$isAlarm, alarm=$alarm, isWaterLeak=$isWaterLeak, waterLeak=$waterLeak, isSmoke=$isSmoke, smoke=$smoke, isVibration=$isVibration, vibration=$vibration, isAction=$isAction, action=$action, isTemperature=$isTemperature, temperature=$temperature, isHumidity=$isHumidity, humidity=$humidity, isPressure=$isPressure, pressure=$pressure, isAirQuality=$isAirQuality, airQuality=$airQuality, isFanSpeed=$isFanSpeed, fanSpeed=$fanSpeed, isFanMode=$isFanMode, fanMode=$fanMode, isConsumption=$isConsumption, consumption=$consumption, isCurrentPower=$isCurrentPower, currentPower=$currentPower, isVoltage=$isVoltage, voltage=$voltage, isLinkQuality=$isLinkQuality, linkQuality=$linkQuality, isCO2=$isCO2, cO2=$cO2, isNoise=$isNoise, noise=$noise]'; Map toJson() { final json = {}; @@ -863,6 +907,26 @@ class DeviceDetailDTOAllOf { } else { json[r'linkQuality'] = null; } + if (this.isCO2 != null) { + json[r'isCO2'] = this.isCO2; + } else { + json[r'isCO2'] = null; + } + if (this.cO2 != null) { + json[r'cO2'] = this.cO2; + } else { + json[r'cO2'] = null; + } + if (this.isNoise != null) { + json[r'isNoise'] = this.isNoise; + } else { + json[r'isNoise'] = null; + } + if (this.noise != null) { + json[r'noise'] = this.noise; + } else { + json[r'noise'] = null; + } return json; } @@ -960,6 +1024,10 @@ class DeviceDetailDTOAllOf { : num.parse(json[r'voltage'].toString()), isLinkQuality: mapValueOfType(json, r'isLinkQuality'), linkQuality: mapValueOfType(json, r'linkQuality'), + isCO2: mapValueOfType(json, r'isCO2'), + cO2: mapValueOfType(json, r'cO2'), + isNoise: mapValueOfType(json, r'isNoise'), + noise: mapValueOfType(json, r'noise'), ); } return null; diff --git a/mycore_api/lib/model/provider_dto.dart b/mycore_api/lib/model/provider_dto.dart index 6cb30bd..6411901 100644 --- a/mycore_api/lib/model/provider_dto.dart +++ b/mycore_api/lib/model/provider_dto.dart @@ -17,11 +17,14 @@ class ProviderDTO { this.name, this.type, this.homeId, + this.serviceHomeId, this.endpoint, this.username, this.password, this.apiKey, this.active, + this.value, + this.valueRefresh, }); String? id; @@ -38,6 +41,8 @@ class ProviderDTO { String? homeId; + String? serviceHomeId; + String? endpoint; String? username; @@ -54,17 +59,24 @@ class ProviderDTO { /// bool? active; + String? value; + + String? valueRefresh; + @override bool operator ==(Object other) => identical(this, other) || other is ProviderDTO && other.id == id && other.name == name && other.type == type && other.homeId == homeId && + other.serviceHomeId == serviceHomeId && other.endpoint == endpoint && other.username == username && other.password == password && other.apiKey == apiKey && - other.active == active; + other.active == active && + other.value == value && + other.valueRefresh == valueRefresh; @override int get hashCode => @@ -73,14 +85,17 @@ class ProviderDTO { (name == null ? 0 : name!.hashCode) + (type == null ? 0 : type!.hashCode) + (homeId == null ? 0 : homeId!.hashCode) + + (serviceHomeId == null ? 0 : serviceHomeId!.hashCode) + (endpoint == null ? 0 : endpoint!.hashCode) + (username == null ? 0 : username!.hashCode) + (password == null ? 0 : password!.hashCode) + (apiKey == null ? 0 : apiKey!.hashCode) + - (active == null ? 0 : active!.hashCode); + (active == null ? 0 : active!.hashCode) + + (value == null ? 0 : value!.hashCode) + + (valueRefresh == null ? 0 : valueRefresh!.hashCode); @override - String toString() => 'ProviderDTO[id=$id, name=$name, type=$type, homeId=$homeId, endpoint=$endpoint, username=$username, password=$password, apiKey=$apiKey, active=$active]'; + String toString() => 'ProviderDTO[id=$id, name=$name, type=$type, homeId=$homeId, serviceHomeId=$serviceHomeId, endpoint=$endpoint, username=$username, password=$password, apiKey=$apiKey, active=$active, value=$value, valueRefresh=$valueRefresh]'; Map toJson() { final json = {}; @@ -104,6 +119,11 @@ class ProviderDTO { } else { json[r'homeId'] = null; } + if (this.serviceHomeId != null) { + json[r'serviceHomeId'] = this.serviceHomeId; + } else { + json[r'serviceHomeId'] = null; + } if (this.endpoint != null) { json[r'endpoint'] = this.endpoint; } else { @@ -129,6 +149,16 @@ class ProviderDTO { } else { json[r'active'] = null; } + if (this.value != null) { + json[r'value'] = this.value; + } else { + json[r'value'] = null; + } + if (this.valueRefresh != null) { + json[r'valueRefresh'] = this.valueRefresh; + } else { + json[r'valueRefresh'] = null; + } return json; } @@ -155,11 +185,14 @@ class ProviderDTO { name: mapValueOfType(json, r'name'), type: ProviderType.fromJson(json[r'type']), homeId: mapValueOfType(json, r'homeId'), + serviceHomeId: mapValueOfType(json, r'serviceHomeId'), endpoint: mapValueOfType(json, r'endpoint'), username: mapValueOfType(json, r'username'), password: mapValueOfType(json, r'password'), apiKey: mapValueOfType(json, r'apiKey'), active: mapValueOfType(json, r'active'), + value: mapValueOfType(json, r'value'), + valueRefresh: mapValueOfType(json, r'valueRefresh'), ); } return null; diff --git a/mycore_api/lib/model/provider_type.dart b/mycore_api/lib/model/provider_type.dart index 2044bb7..211e10c 100644 --- a/mycore_api/lib/model/provider_type.dart +++ b/mycore_api/lib/model/provider_type.dart @@ -27,6 +27,7 @@ class ProviderType { static const meross = ProviderType._(r'meross'); static const yeelight = ProviderType._(r'yeelight'); static const zigbee2mqtt = ProviderType._(r'zigbee2mqtt'); + static const netatmo = ProviderType._(r'netatmo'); /// List of all possible values in this [enum][ProviderType]. static const values = [ @@ -34,6 +35,7 @@ class ProviderType { meross, yeelight, zigbee2mqtt, + netatmo, ]; static ProviderType? fromJson(dynamic value) => ProviderTypeTypeTransformer().decode(value); @@ -76,6 +78,7 @@ class ProviderTypeTypeTransformer { case r'meross': return ProviderType.meross; case r'yeelight': return ProviderType.yeelight; case r'zigbee2mqtt': return ProviderType.zigbee2mqtt; + case r'netatmo': return ProviderType.netatmo; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data');