├── .directory ├── .idea ├── modules.xml ├── vcs.xml ├── cbj_smart-home.iml └── workspace.xml ├── .gitmodules ├── ProtoFiles ├── protos │ ├── aioesphomeapi │ │ ├── api_options.proto │ │ └── api.proto │ ├── cbj_app_connections.proto │ ├── security_bear_connections.proto │ ├── cbj_smart_device_server.proto │ └── cbj_hub_server.proto └── proto_script.sh ├── README.md ├── .gitignore └── LICENSE /.directory: -------------------------------------------------------------------------------- 1 | [Dolphin] 2 | Timestamp=2019,10,11,13,39,42 3 | Version=4 4 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cbj_remote-pipes"] 2 | path = cbj_remote-pipes 3 | url = https://github.com/CyBear-Jinni/cbj_remote-pipes.git 4 | [submodule "cbj_hub"] 5 | path = cbj_hub 6 | url = https://github.com/CyBear-Jinni/cbj_hub.git 7 | [submodule "cbj_app"] 8 | path = cbj_app 9 | url = https://github.com/CyBear-Jinni/cbj_app.git 10 | [submodule "remote_pipes_routing"] 11 | path = remote_pipes_routing 12 | url = https://github.com/CyBear-Jinni/remote_pipes_routing.git 13 | [submodule "security_bear"] 14 | path = security_bear 15 | url = https://github.com/CyBear-Jinni/security_bear.git 16 | [submodule "cbj_smart-device"] 17 | path = cbj_smart-device 18 | url = https://github.com/CyBear-Jinni/cbj_smart-device.git 19 | -------------------------------------------------------------------------------- /ProtoFiles/protos/aioesphomeapi/api_options.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | import "google/protobuf/descriptor.proto"; 3 | 4 | 5 | enum APISourceType { 6 | SOURCE_BOTH = 0; 7 | SOURCE_SERVER = 1; 8 | SOURCE_CLIENT = 2; 9 | } 10 | 11 | message void {} 12 | 13 | extend google.protobuf.MethodOptions { 14 | optional bool needs_setup_connection = 1038 [default=true]; 15 | optional bool needs_authentication = 1039 [default=true]; 16 | } 17 | 18 | extend google.protobuf.MessageOptions { 19 | optional uint32 id = 1036 [default=0]; 20 | optional APISourceType source = 1037 [default=SOURCE_BOTH]; 21 | optional string ifdef = 1038; 22 | optional bool log = 1039 [default=true]; 23 | optional bool no_delay = 1040 [default=false]; 24 | } 25 | -------------------------------------------------------------------------------- /ProtoFiles/protos/cbj_app_connections.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package CBJAppConnections; 4 | 5 | 6 | service CyBearJinniApp { 7 | rpc CBJAppGetSmartDeviceInformation (CompInfoSB) returns (CBJCommendStatus); 8 | 9 | /// Get computer yaml and protoc version and more info about the computer 10 | rpc getCompAppInfo (CompAppInfo) returns (CompAppInfo); 11 | } 12 | 13 | message CompInfoSB { 14 | string compIP = 2; 15 | } 16 | 17 | // Did the commend arrived (true) or not (false) 18 | message CBJCommendStatus { 19 | bool success = 1; 20 | } 21 | 22 | message CompAppInfo { 23 | CbjAppIno cbjInfo = 3; 24 | CompAppSpecs compSpecs = 4; 25 | } 26 | 27 | message CbjAppIno { 28 | string deviceName = 5; 29 | string pubspecYamlVersion = 6; 30 | string pubspecYamlBuildNumber = 14; 31 | string protoLastGenDate = 7; 32 | string dartSdkVersion = 15; 33 | } 34 | 35 | message CompAppSpecs { 36 | string compId = 8; 37 | string compUuid = 9; 38 | string compOs = 10; 39 | string compModel = 11; 40 | string compType = 12; 41 | string compIp = 13; 42 | } 43 | -------------------------------------------------------------------------------- /ProtoFiles/protos/security_bear_connections.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package SecurityBearConnections; 4 | 5 | // The greeting service definition. 6 | service SecurityBear { 7 | rpc SetWiFiInformation (SecurityBearSetup) returns (SBCommendStatus); 8 | 9 | rpc SetFirebaseAccountAndSecurityBearSetup (SBFirebaseAccountAndSecurityBearSetup) returns (SBCommendStatus); 10 | 11 | /// Get computer yaml and protoc version and more info about the computer 12 | rpc getCompSecurityBearInfo (CompSecurityBearInfo) returns (CompSecurityBearInfo); 13 | } 14 | 15 | message SecurityBearSetup { 16 | WiFiInformation wiFiFirstPriority = 3; 17 | WiFiInformation wiFiSecondPriority = 4; 18 | } 19 | 20 | message WiFiInformation { 21 | string wiFiName = 1; 22 | string wiFiPassword = 2; 23 | } 24 | 25 | // Did the commend succeeded (true) or not (false) 26 | message SBCommendStatus { 27 | bool success = 5; 28 | } 29 | 30 | 31 | message SBFirebaseAccountAndSecurityBearSetup { 32 | SBFirebaseAccountInformation sBFirebaseAccountInformation = 10; 33 | SecurityBearSetup securityBearSetup = 11; 34 | } 35 | 36 | message SBFirebaseAccountInformation { 37 | string fireBaseProjectId = 6; 38 | string fireBaseApiKey = 7; 39 | string userEmail = 8; 40 | string userPassword = 9; 41 | } 42 | 43 | message CompSecurityBearInfo { 44 | CbjSecurityBearIno cbjInfo = 12; 45 | CompSecurityBearSpecs compSpecs = 13; 46 | } 47 | 48 | message CbjSecurityBearIno { 49 | string deviceName = 14; 50 | string pubspecYamlVersion = 15; 51 | string pubspecYamlBuildNumber = 23; 52 | string protoLastGenDate = 16; 53 | string dartSdkVersion = 24; 54 | } 55 | 56 | message CompSecurityBearSpecs { 57 | string compId = 17; 58 | string compUuid = 18; 59 | string compOs = 19; 60 | string compModel = 20; 61 | string compType = 21; 62 | string compIp = 22; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

CyBear Jinni Smart Home

2 | 3 |
4 | 5 | [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) [Open Source Love](https://en.wikipedia.org/wiki/Open_source) 6 | 7 |
8 | 9 | 10 | [
CyBear Jinni image
](https://github.com/CyBear-Jinni/CBJ_Smart-Home) 11 | 12 | 13 | # Welcome! 14 | 15 | This repository let you **control** your existing smart home. 16 | 17 | Here at CyBear Jinni we give the community the power of smart home by providing the code and instructions to set up a Hub that will let you control your smart devices and connect them even if they are from different form factors. 18 | 19 | 20 | 21 | 22 | ## Project structure 23 | 24 | The project is made out of two main parts: 25 | 26 | ### CyBear Jinni App 27 | 28 | [CyBear Jinni App](https://github.com/CyBear-Jinni/cbj_app) is the app to control your [CyBear Jinni Hub](https://github.com/CyBear-Jinni/cbj_hub). 29 | 30 | This is an Android, IOS, Web Browser app written in [Flutter](https://flutter.dev) that let you control the Hub using local Wi-Fi and remotely through [cbj remote pipes](https://github.com/CyBear-Jinni/cbj_remote-pipes) which transfer requests to the Hub without collecting any data. 31 | 32 | 33 | Android Badge 34 | 35 | ### CyBear Jinni Hub 36 | 37 | 38 | [CyBear Jinni Hub](https://github.com/CyBear-Jinni/cbj_hub) is software written in [dart](https://dart.dev) and runs in parallel with MQTT broker. 39 | 40 | The Hub talks to all the supported smart devices from different form factors and gives the app an easy and uniform way to control them as if they are from the same company. 41 | 42 | 43 | [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/cbj-hub) 44 | 45 | 46 | # Social Media Links 47 | 48 | 49 | Twitter 50 | 51 | Instagram 52 | 53 | Linkedin 54 | 55 | Discord 56 | 57 | Github 58 |

59 | 60 | ## Disclaimers 61 | 62 | **Use at Your Own Risk,** 63 | **we do not take responsibility on any outcome using anything in this repo.** 64 | 65 | The project is under heavy work and may contain bugs and incorrect instructions. 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://www.dartlang.org/guides/libraries/private-files 2 | 3 | # Files and directories created by pub 4 | .dart_tool/ 5 | .packages 6 | .pub/ 7 | build/ 8 | # If you're building an application, you may want to check-in your pubspec.lock 9 | pubspec.lock 10 | 11 | # Directory created by dartdoc 12 | # If you don't generate documentation locally you can remove this line. 13 | doc/api/ 14 | smart_home_flutter/gen/ 15 | /SmartDevice/parts/ 16 | /SmartDevice/prime/ 17 | /SmartDevice/stage/ 18 | /SmartDevice/*.snap 19 | /SmartDevice/*_armhf.txt 20 | /FlutterApp/smart_home_flutter/ios/Flutter/flutter_export_environment.sh 21 | /FlutterApp/smart_home_flutter/.flutter-plugins-dependencies 22 | 23 | /Files/googlePlayStore/ 24 | 25 | 26 | 27 | 28 | 29 | 30 | # The .vscode folder contains launch configuration and tasks you configure in 31 | # VS Code which you may wish to be included in version control, so this line 32 | # is commented out by default. 33 | #.vscode/ 34 | 35 | # Generated by flutter dependencies 36 | *.freezed.dart 37 | flutter-plugins 38 | # Privat data 39 | lib/infrastructure/core/constant_credentials.dart 40 | 41 | # Web related 42 | lib/generated_plugin_registrant.dart 43 | 44 | # Obfuscation related 45 | app.*.map.json 46 | 47 | injection.config.dart 48 | *.gr.dart 49 | 50 | 51 | 52 | # Miscellaneous 53 | *.class 54 | *.lock 55 | *.log 56 | *.pyc 57 | *.swp 58 | .DS_Store 59 | .atom/ 60 | .buildlog/ 61 | .history 62 | .svn/ 63 | 64 | # IntelliJ related 65 | *.iml 66 | *.ipr 67 | *.iws 68 | .idea/ 69 | 70 | # Visual Studio Code related 71 | .classpath 72 | .project 73 | .settings/ 74 | .vscode/ 75 | 76 | # Flutter repo-specific 77 | /bin/cache/ 78 | /bin/internal/bootstrap.bat 79 | /bin/internal/bootstrap.sh 80 | /bin/mingit/ 81 | /dev/benchmarks/mega_gallery/ 82 | /dev/bots/.recipe_deps 83 | /dev/bots/android_tools/ 84 | /dev/devicelab/ABresults*.json 85 | /dev/docs/doc/ 86 | /dev/docs/flutter.docs.zip 87 | /dev/docs/lib/ 88 | /dev/docs/pubspec.yaml 89 | /dev/integration_tests/**/xcuserdata 90 | /dev/integration_tests/**/Pods 91 | /packages/flutter/coverage/ 92 | version 93 | analysis_benchmark.json 94 | 95 | # packages file containing multi-root paths 96 | .packages.generated 97 | 98 | # Flutter/Dart/Pub related 99 | **/doc/api/ 100 | .flutter-plugins 101 | .flutter-plugins-dependencies 102 | **/generated_plugin_registrant.dart 103 | .pub-cache/ 104 | flutter_*.png 105 | linked_*.ds 106 | unlinked.ds 107 | unlinked_spec.ds 108 | 109 | # Android related 110 | **/android/**/gradle-wrapper.jar 111 | **/android/.gradle 112 | **/android/captures/ 113 | **/android/gradlew 114 | **/android/gradlew.bat 115 | **/android/local.properties 116 | **/android/**/GeneratedPluginRegistrant.java 117 | **/android/key.properties 118 | *.jks 119 | 120 | # iOS/XCode related 121 | **/ios/**/*.mode1v3 122 | **/ios/**/*.mode2v3 123 | **/ios/**/*.moved-aside 124 | **/ios/**/*.pbxuser 125 | **/ios/**/*.perspectivev3 126 | **/ios/**/*sync/ 127 | **/ios/**/.sconsign.dblite 128 | **/ios/**/.tags* 129 | **/ios/**/.vagrant/ 130 | **/ios/**/DerivedData/ 131 | **/ios/**/Icon? 132 | **/ios/**/Pods/ 133 | **/ios/**/.symlinks/ 134 | **/ios/**/profile 135 | **/ios/**/xcuserdata 136 | **/ios/.generated/ 137 | **/ios/Flutter/.last_build_id 138 | **/ios/Flutter/App.framework 139 | **/ios/Flutter/Flutter.framework 140 | **/ios/Flutter/Flutter.podspec 141 | **/ios/Flutter/Generated.xcconfig 142 | **/ios/Flutter/ephemeral 143 | **/ios/Flutter/app.flx 144 | **/ios/Flutter/app.zip 145 | **/ios/Flutter/flutter_assets/ 146 | **/ios/Flutter/flutter_export_environment.sh 147 | **/ios/ServiceDefinitions.json 148 | **/ios/Runner/GeneratedPluginRegistrant.* 149 | 150 | # macOS 151 | **/macos/Flutter/GeneratedPluginRegistrant.swift 152 | 153 | # Coverage 154 | coverage/ 155 | 156 | # Symbols 157 | app.*.symbols 158 | 159 | # Exceptions to above rules. 160 | !**/ios/**/default.mode1v3 161 | !**/ios/**/default.mode2v3 162 | !**/ios/**/default.pbxuser 163 | !**/ios/**/default.perspectivev3 164 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 165 | !/dev/ci/**/Gemfile.lock -------------------------------------------------------------------------------- /ProtoFiles/proto_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # You mast have pub and protoc inside the path 4 | # Example PATH=$PATH:~/Programs/flutter/bin/cache/dart-sdk/bin 5 | 6 | dart pub global activate protoc_plugin 7 | 8 | export PATH="$PATH":"$HOME/.pub-cache/bin" 9 | 10 | 11 | # Connection between App to Security Bear 12 | 13 | mkdir protoc_as_dart 14 | 15 | # TODO: Add check if protoc command is installed, if not that show to the user protoc 16 | # installations methods 17 | # The recommended one "sudo snap install protobuf" 18 | # Didn't test and old version "sudo apt install protobuf-compiler" 19 | protoc --dart_out=grpc:protoc_as_dart/ -Iprotos protos/security_bear_connections.proto 20 | 21 | 22 | rm -r ../security_bear/lib/infrastructure/gen/security_bear_server_d/protoc_as_dart 23 | cp -r protoc_as_dart/ ../security_bear/lib/infrastructure/gen/security_bear_server_d # Copy to Security Bear protoc folder 24 | date +"const securityBearServerProtocGenDate = '%d/%m/%y';">../security_bear/lib/infrastructure/gen/security_bear_server_d/proto_gen_date.dart 25 | 26 | rm -r ../cbj_app/lib/infrastructure/core/gen/security_bear/client/protoc_as_dart 27 | cp -r protoc_as_dart/ ../cbj_app/lib/infrastructure/core/gen/security_bear/client # Copy to CBJ App protoc folder 28 | date +"const securityBearClientProtocGenDate = '%d/%m/%y';">../cbj_app/lib/infrastructure/core/gen/security_bear/proto_gen_date.dart 29 | 30 | rm -r protoc_as_dart 31 | 32 | 33 | 34 | # Connection between Security Bear to the App 35 | 36 | mkdir protoc_as_dart 37 | 38 | protoc --dart_out=grpc:protoc_as_dart/ -Iprotos protos/cbj_app_connections.proto 39 | 40 | 41 | 42 | rm -r ../cbj_app/lib/infrastructure/core/gen/cbj_app_server/protoc_as_dart 43 | cp -r protoc_as_dart/ ../cbj_app/lib/infrastructure/core/gen/cbj_app_server # Copy to CBJ App protoc folder 44 | date +"const appServerProtocGenDate = '%d/%m/%y';">../cbj_app/lib/infrastructure/core/gen/cbj_app_server/proto_gen_date.dart 45 | 46 | rm -r ../security_bear/lib/infrastructure/gen/cbj_app/protoc_as_dart 47 | cp -r protoc_as_dart/ ../security_bear/lib/infrastructure/gen/cbj_app # Copy to Security Bear protoc folder 48 | date +"const appClientProtocGenDate = '%d/%m/%y';">../security_bear/lib/infrastructure/gen/cbj_app/proto_gen_date.dart 49 | 50 | 51 | rm -r protoc_as_dart 52 | 53 | 54 | # Connection between Hub to the App and Remote Pipes and Remote Pipes Routing 55 | 56 | mkdir protoc_as_dart 57 | 58 | protoc --dart_out=grpc:protoc_as_dart/ -Iprotos protos/cbj_hub_server.proto 59 | 60 | 61 | 62 | rm -r ../cbj_hub/lib/infrastructure/gen/cbj_hub_server/protoc_as_dart 63 | cp -r -p protoc_as_dart/ ../cbj_hub/lib/infrastructure/gen/cbj_hub_server/ # # copy to Remote-Pipes protoc folder 64 | date +"const hubServerProtocGenDate = '%d/%m/%y';">../cbj_hub/lib/infrastructure/gen/cbj_hub_server/proto_gen_date.dart 65 | 66 | rm -r ../cbj_app/lib/infrastructure/core/gen/cbj_hub_server/protoc_as_dart 67 | cp -r protoc_as_dart/ ../cbj_app/lib/infrastructure/core/gen/cbj_hub_server # Copy to CBJ App protoc folder 68 | date +"const hubClientProtocGenDate = '%d/%m/%y';">../cbj_app/lib/infrastructure/core/gen/cbj_hub_server/proto_gen_date.dart 69 | 70 | rm -r ../cbj_remote-pipes/lib/infrastructure/gen/cbj_hub_server/protoc_as_dart 71 | cp -r -p protoc_as_dart/ ../cbj_remote-pipes/lib/infrastructure/gen/cbj_hub_server/ # # copy to Remote-Pipes protoc folder 72 | date +"const hubServerProtocGenDate = '%d/%m/%y';">../cbj_remote-pipes/lib/infrastructure/gen/cbj_hub_server/proto_gen_date.dart 73 | 74 | rm -r ../remote_pipes_routing/lib/infrastructure/gen/cbj_hub_server/protoc_as_dart 75 | cp -r -p protoc_as_dart/ ../remote_pipes_routing/lib/infrastructure/gen/cbj_hub_server/ # # copy to Remote-Pipes Routing protoc folder 76 | date +"const hubServerProtocGenDate = '%d/%m/%y';">../remote_pipes_routing/lib/infrastructure/gen/cbj_hub_server/proto_gen_date.dart 77 | 78 | 79 | 80 | rm -r protoc_as_dart 81 | 82 | 83 | 84 | 85 | 86 | # Connection between Hub and ESPHome 87 | 88 | mkdir protoc_as_dart 89 | 90 | 91 | protoc --dart_out=protoc_as_dart/ -Iprotos protos/aioesphomeapi/api.proto protos/aioesphomeapi/api_options.proto 92 | 93 | 94 | 95 | rm -r ../cbj_hub/lib/infrastructure/gen/aioesphomeapi/protoc_as_dart 96 | cp -r -p protoc_as_dart/ ../cbj_hub/lib/infrastructure/gen/aioesphomeapi/ # # copy to Remote-Pipes protoc folder 97 | date +"const hubAioEspHomeApiClientProtocGenDate = '%d/%m/%y';">../cbj_hub/lib/infrastructure/gen/aioesphomeapi/proto_gen_date.dart 98 | 99 | 100 | rm -r protoc_as_dart 101 | 102 | 103 | 104 | 105 | 106 | # Connection between Hub to Smart Device 107 | 108 | mkdir protoc_as_dart 109 | 110 | protoc --dart_out=grpc:protoc_as_dart/ -Iprotos protos/cbj_smart_device_server.proto 111 | 112 | 113 | rm -r ../cbj_smart-device/lib/infrastructure/gen/cbj_smart_device_server/protoc_as_dart 114 | cp -r -p protoc_as_dart/ ../cbj_smart-device/lib/infrastructure/gen/cbj_smart_device_server/ # # copy to smart device protoc folder 115 | 116 | rm -r ../cbj_hub/lib/infrastructure/gen/cbj_smart_device_server/protoc_as_dart 117 | cp -r -p protoc_as_dart/ ../cbj_hub/lib/infrastructure/gen/cbj_smart_device_server/ # # copy to Hub protoc folder 118 | 119 | 120 | rm -r protoc_as_dart 121 | -------------------------------------------------------------------------------- /ProtoFiles/protos/cbj_smart_device_server.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package CbjSmartDeviceConnections; 4 | 5 | /// The greeting service definition. 6 | service CbjSmartDeviceConnections { 7 | /// Sends a greeting 8 | rpc FirstSetup (CbjFirstSetupMessage) returns (CbjCommendStatus); 9 | rpc GetCompInfo (CbjCommendStatus) returns (CbjCompSmartDeviceInfo); 10 | rpc SetCompInfo (CbjCompSmartDeviceInfo) returns (CbjCommendStatus); 11 | rpc SetFirebaseAccountInformation (CbjFirebaseAccountInformation) returns (CbjCommendStatus); 12 | rpc GetStatus (CbjSmartDeviceInfo) returns (CbjSmartDeviceStatus); 13 | rpc UpdateDeviceName (CbjSmartDeviceUpdateDetails) returns (CbjCommendStatus); 14 | rpc SetOnDevice (CbjSmartDeviceInfo) returns (CbjCommendStatus); 15 | rpc SetOffDevice (CbjSmartDeviceInfo) returns (CbjCommendStatus); 16 | rpc setBlindsUp (CbjSmartDeviceInfo) returns (CbjCommendStatus); 17 | rpc setBlindsDown (CbjSmartDeviceInfo) returns (CbjCommendStatus); 18 | rpc setBlindsStop (CbjSmartDeviceInfo) returns (CbjCommendStatus); 19 | 20 | /// Client side sending requests for the hub like turn entrance light on, 21 | /// and updating about it status like client opened movie (for the hub to process). 22 | /// Getting requests from the hub like play music on the phone, and status of devices that 23 | /// have been changed like update layout to show entrance lights on. 24 | rpc RegisterClient (stream CbjClientStatusRequests) returns (stream CbjRequestsAndStatusFromHub); 25 | 26 | /// Hub side sending requests for the clients like turn on music, and updated status of devices 27 | /// like entrance light got turned on. 28 | /// Getting request like to turn on lights, and getting client updated status to process like 29 | /// client opened a move. 30 | rpc RegisterHub (stream CbjRequestsAndStatusFromHub) returns (stream CbjClientStatusRequests); 31 | 32 | /// Suspending the computer 33 | rpc suspendComputer (CbjSmartDeviceInfo) returns (CbjCommendStatus); 34 | 35 | /// Shutdown the computer 36 | rpc shutdownComputer (CbjSmartDeviceInfo) returns (CbjCommendStatus); 37 | 38 | } 39 | 40 | 41 | enum CbjDeviceTypes { 42 | typeNotSupported = 0; 43 | light = 1; 44 | blinds = 2; 45 | boiler = 3; 46 | button = 4; 47 | buttonWithLight = 5; 48 | hub = 7; 49 | phoneApp = 8; 50 | computerApp = 9; 51 | browserApp = 10; 52 | smartComputer = 11; 53 | } 54 | 55 | enum CbjDeviceActions { 56 | actionNotSupported = 0; 57 | on = 1; 58 | off = 2; 59 | moveUp = 3; 60 | stop = 4; 61 | moveDown = 5; 62 | pressed = 6; // for buttons 63 | longPress = 7; // for buttons 64 | doubleTap = 8; // for buttons 65 | position = 9; // Example: for blinds height 66 | suspend = 10; // Suspend the computer 67 | shutdown =11; // Shut down the computer 68 | itIsFalse = 12; 69 | itIsTrue = 13; 70 | } 71 | 72 | 73 | enum CbjWhenToExecute { 74 | undefined = 0; 75 | onOddNumberPress = 1; 76 | evenNumberPress = 2; 77 | betweenSelectedTime = 3; 78 | doNotBetweenSelectedTime = 4; 79 | allTheTime = 5; 80 | never = 6; 81 | onceNow = 7; 82 | onceInSelectedTime = 8; 83 | onlyIfDeviceListIsAreInActionListState = 9; 84 | atHome = 10; 85 | outOfHome = 11; 86 | } 87 | 88 | 89 | enum CbjDeviceStateGRPC { 90 | stateNotSupported = 0; 91 | /// Cancel if not ack yet 92 | cancelStateInProcess = 1; 93 | /// Acknowledge that the state was updated 94 | ack = 2; 95 | /// New State was failed to execute 96 | newStateFailed = 3; 97 | /// Comp/Hub is trying to execute and waiting ack 98 | waitingInComp = 4; 99 | } 100 | 101 | 102 | message CbjClientStatusRequests { 103 | CbjAllRemoteCommands allRemoteCommands = 41; 104 | } 105 | 106 | 107 | message CbjRequestsAndStatusFromHub { 108 | CbjAllRemoteCommands allRemoteCommands = 42; 109 | } 110 | 111 | 112 | message CbjAllRemoteCommands { 113 | CbjSmartDeviceInfo smartDeviceInfo = 40; 114 | } 115 | 116 | message CbjFirstSetupMessage { 117 | CbjCompSmartDeviceInfo compInfo = 38; 118 | CbjFirebaseAccountInformation firebaseAccountInformation = 39; 119 | } 120 | 121 | message CbjCompSmartDeviceInfo { 122 | CbjCompSpecs compSpecs = 21; 123 | repeated CbjSmartDeviceInfo smartDevicesInComp = 28; 124 | } 125 | 126 | 127 | message CbjCompSpecs { 128 | string compId = 22; 129 | string compUuid = 23; 130 | string compOs = 24; 131 | string compModel = 25; 132 | string compType = 26; 133 | string pubspecYamlVersion = 27; 134 | } 135 | 136 | message CbjMicrocontrollerSpecs { 137 | string microcontrollerModel = 31; 138 | string microcontrollerType = 32; 139 | string softwareVersion = 33; 140 | } 141 | 142 | /// The request message containing the user's name. 143 | message CbjSmartDeviceInfo { 144 | string id = 1; 145 | string state = 3; 146 | string defaultName = 14; 147 | string roomId = 15; 148 | string senderDeviceModel = 16; 149 | string senderDeviceOs = 17; 150 | string senderId = 18; 151 | string serverTimeStamp = 19; 152 | string stateMassage = 20; 153 | 154 | bool isComputer = 29; 155 | 156 | CbjCompSpecs compSpecs = 30; 157 | 158 | CbjMicrocontrollerSpecs microcontrollerSpecsSpecs = 31; 159 | 160 | CbjDeviceTypesActions deviceTypesActions = 34; 161 | } 162 | 163 | /// The response message containing the greetings 164 | message CbjSmartDeviceStatus { 165 | bool onOffState = 4; 166 | } 167 | 168 | /// Did the commend succeeded (true) or not (false) 169 | message CbjCommendStatus { 170 | bool success = 5; 171 | } 172 | 173 | message CbjSmartDeviceUpdateDetails { 174 | CbjSmartDeviceInfo smartDevice = 6; 175 | string newName = 7; 176 | } 177 | 178 | message CbjFirebaseAccountInformation { 179 | string fireBaseProjectId = 8; 180 | string fireBaseApiKey = 9; 181 | string userEmail = 10; 182 | string userPassword = 11; 183 | string homeId = 12; 184 | } 185 | 186 | message CbjDeviceTypesActions { 187 | CbjDeviceTypes deviceType = 35; 188 | CbjDeviceActions deviceAction = 36; 189 | CbjDeviceStateGRPC deviceStateGRPC = 37; 190 | } 191 | -------------------------------------------------------------------------------- /ProtoFiles/protos/cbj_hub_server.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package CbjHub; 4 | 5 | /// The greeting service definition. 6 | service CbjHub { 7 | /// Client side sending requests for the hub like turn entrance light on, 8 | /// and updating about it status like client opened movie (for the hub to process). 9 | /// Getting requests from the hub like play music on the phone, and status of devices that 10 | /// have been changed like update layout to show entrance lights on. 11 | rpc ClientTransferDevices (stream ClientStatusRequests) returns (stream RequestsAndStatusFromHub); 12 | 13 | /// Hub side sending requests for the clients like turn on music, and updated status of devices 14 | /// like entrance light got turned on. 15 | /// Getting request like to turn on lights, and getting client updated status to process like 16 | /// client opened a move. 17 | rpc HubTransferDevices (stream RequestsAndStatusFromHub) returns (stream ClientStatusRequests); 18 | 19 | /// Get computer yaml and protoc version and more info about the computer 20 | rpc getCompHubInfo (CompHubInfo) returns (CompHubInfo); 21 | } 22 | 23 | 24 | /// Being added to send data for explain the type that was sent 25 | enum SendingType { 26 | /// Not sure what we sent or got 27 | undefinedType = 0; 28 | /// String without any structure 29 | stringType = 1; 30 | /// Partial device data in the form of json 31 | partialDeviceType = 2; 32 | /// Device object in the form of json 33 | deviceType = 3; 34 | /// Sending mqtt massage 35 | mqttMassageType = 4; 36 | /// Scenes 37 | sceneType = 5; 38 | /// Schedule 39 | scheduleType = 6; 40 | /// Routine 41 | routineType = 7; 42 | /// Bindings 43 | bindingsType = 8; 44 | /// Type for login into other vendors 45 | vendorLoginType = 9; 46 | /// First connection, for sending first connection info like all devices status and more 47 | firstConnection = 10; 48 | /// Remote Pipes Domain information 49 | remotePipesInformation = 11; 50 | /// Request to get the device and software ifo like proto file version and more 51 | getHubDeviceInfo = 12; 52 | /// Response that contains device and software ifo like proto file version 53 | responseHubDeviceInfo = 13; 54 | /// Response that contains room object 55 | roomType = 14; 56 | /// Sending location of device 57 | location = 15; 58 | } 59 | 60 | 61 | enum DeviceStateGRPC { 62 | stateNotSupported = 0; 63 | /// Cancel if not ack yet 64 | cancelStateInProcess = 1; 65 | /// Acknowledge that the state was updated 66 | ack = 2; 67 | /// New State was failed to execute 68 | newStateFailed = 3; 69 | /// Waiting for device to take action from firebase and ack 70 | waitingInFirebase = 4; 71 | /// Comp/Hub is trying to execute and waiting ack 72 | waitingInComp = 5; 73 | /// No devices to transfer 74 | noDevicesToTransfer = 6; 75 | /// Ping the other side 76 | pingNow = 7; 77 | /// Adding new scene 78 | addingNewScene = 8; 79 | /// Adding new routine 80 | addingNewRoutine = 9; 81 | /// Adding new binding 82 | addingNewBinding = 10; 83 | /// Update hub device object properties from the real device 84 | updateHubDevicePropertiesFromRealDevice = 11; 85 | } 86 | 87 | 88 | enum VendorsAndServices { 89 | vendorsAndServicesNotSupported = 0; 90 | espHome = 1; 91 | switcherSmartHome = 2; 92 | tasmota = 3; 93 | yeelight = 4; 94 | google = 5; 95 | miHome = 6; 96 | lifx = 7; 97 | tuyaSmart = 8; 98 | smartLife = 9; 99 | jinvooSmart = 10; 100 | shelly = 11; 101 | wink = 12; 102 | ikea = 13; 103 | sonoffDiy = 14; 104 | philipsHue = 15; 105 | lg = 16; 106 | spotify = 17; 107 | homeAssistant = 18; 108 | hp = 19; 109 | yeelink = 20; 110 | xiaomi = 21; 111 | sonoffEweLink = 22; 112 | cbjDevices = 23; 113 | } 114 | 115 | 116 | enum DeviceTypes { 117 | typeNotSupported = 0; 118 | light = 1; 119 | blinds = 2; 120 | boiler = 3; 121 | button = 4; 122 | buttonWithLight = 5; 123 | hub = 7; 124 | /// The app running on a phone. 125 | phoneApp = 8; 126 | /// The app running on a computer. 127 | computerApp = 9; 128 | /// The app running on a browser. 129 | browserApp = 10; 130 | switch = 11; 131 | dimmableLight = 12; 132 | cctLight = 13; 133 | rgbLights = 14; 134 | rgbwLights = 15; 135 | rgbcctLights = 16; 136 | smartTV = 17; 137 | smartSpeakers = 18; 138 | coffeeMachine = 19; 139 | kettle = 20; 140 | teapot = 21; 141 | washingMachine = 22; 142 | dishwasher = 23; 143 | toaster = 24; 144 | vacuumCleaner = 25; 145 | refrigerator = 26; 146 | bed = 27; 147 | oven = 28; 148 | AirConditioner = 29; 149 | smartWatch = 30; 150 | smartWaterBottle = 31; 151 | microphone = 32; 152 | securityCamera = 33; 153 | babyMonitor = 34; 154 | motionSensor = 35; 155 | temperatureSensor = 36; 156 | humiditySensor = 37; 157 | lightSensor = 38; 158 | soundSensor = 39; 159 | smokeSensor = 40; 160 | smokeDetector = 41; 161 | oxygenSensor = 42; 162 | smartPlug = 43; 163 | printer = 44; 164 | scanner = 45; 165 | printerWithScanner = 46; 166 | /// Device with full computer excess like executing commands and checking process status. 167 | smartComputer = 47; 168 | 169 | } 170 | 171 | 172 | enum DeviceActions { 173 | actionNotSupported = 0; 174 | on = 1; 175 | off = 2; 176 | moveUp = 3; 177 | stop = 4; 178 | moveDown = 5; 179 | pressed = 6; // for buttons 180 | longPress = 7; // for buttons 181 | doubleTap = 8; // for buttons 182 | position = 9; // Example: for blinds height 183 | suspend = 10; // Suspend the computer 184 | shutdown =11; // Shut down the computer 185 | itIsFalse = 12; 186 | itIsTrue = 13; 187 | } 188 | 189 | 190 | enum WhenToExecute { 191 | undefined = 0; 192 | onOddNumberPress = 1; 193 | evenNumberPress = 2; 194 | betweenSelectedTime = 3; 195 | doNotBetweenSelectedTime = 4; 196 | allTheTime = 5; 197 | never = 6; 198 | onceNow = 7; 199 | onceInSelectedTime = 8; 200 | onlyIfDeviceListIsAreInActionListState = 9; 201 | atHome = 10; 202 | outOfHome = 11; 203 | atASpecificTime = 12; // Example: Only on Sunday and Tuesday at 5:35 204 | } 205 | 206 | /// List of purposes that each area in the home can have 207 | enum AreaPurposesTypes { 208 | bedroom = 0; 209 | studyRoom = 1; 210 | workRoom = 2; 211 | tvRoom = 3; 212 | videoGames = 4; 213 | livingRoom = 5; 214 | diningRoom = 6; 215 | kitchen = 7; 216 | outside = 8; 217 | outsidePrimary = 9; 218 | outsideNotPrimary = 10; 219 | toiletRoom = 11; 220 | shower = 12; 221 | trainingRoom = 13; 222 | meditation = 14; 223 | romantic = 15; 224 | stairsInside = 16; 225 | stairsOutside = 17; 226 | childrensRoom = 18; 227 | cinemaRoom = 19; 228 | boardGames = 20; 229 | bathtub = 21; 230 | laundryRoom = 22; 231 | protectedSpace = 23; 232 | safeRoom = 24; 233 | attic = 25; 234 | holidayCabin = 26; 235 | } 236 | 237 | 238 | message ClientStatusRequests { 239 | SendingType sendingType = 41; 240 | string allRemoteCommands = 42; 241 | } 242 | 243 | message RequestsAndStatusFromHub { 244 | SendingType sendingType = 43; 245 | string allRemoteCommands = 44; 246 | } 247 | 248 | message AllRemoteCommands { 249 | SmartDeviceInfo smartDeviceInfo = 40; 250 | } 251 | 252 | message FirstSetupMessage { 253 | CompHubInfo compInfo = 38; 254 | FirebaseAccountInformation firebaseAccountInformation = 39; 255 | } 256 | 257 | message CompHubInfo { 258 | CbjHubIno cbjInfo = 47; 259 | CompHubSpecs compSpecs = 21; 260 | } 261 | 262 | message CbjHubIno { 263 | string deviceName = 48; 264 | string pubspecYamlVersion = 27; 265 | string pubspecYamlBuildNumber = 51; 266 | string protoLastGenDate = 49; 267 | string dartSdkVersion = 52; 268 | } 269 | 270 | message CompHubSpecs { 271 | string compId = 22; 272 | string compUuid = 23; 273 | string compOs = 24; 274 | string compModel = 25; 275 | string compType = 26; 276 | string compIp = 50; 277 | } 278 | 279 | message MicrocontrollerSpecs { 280 | string microcontrollerModel = 31; 281 | string microcontrollerType = 32; 282 | string softwareVersion = 33; 283 | } 284 | 285 | /// The request message containing the user's name. 286 | message SmartDeviceInfo { 287 | string id = 1; 288 | string state = 3; 289 | string defaultName = 14; 290 | string roomId = 15; 291 | string senderDeviceModel = 16; 292 | string senderDeviceOs = 17; 293 | string senderId = 18; 294 | string serverTimeStamp = 19; 295 | string stateMassage = 20; 296 | MqttMassage mqttMassage = 43; 297 | 298 | bool isComputer = 29; 299 | 300 | CompHubSpecs compSpecs = 30; 301 | 302 | MicrocontrollerSpecs microcontrollerSpecsSpecs = 31; 303 | 304 | DeviceTypesActions deviceTypesActions = 34; 305 | } 306 | 307 | /// The response message containing the greetings 308 | message SmartDeviceStatus { 309 | bool onOffState = 4; 310 | } 311 | 312 | message MqttMassage { 313 | string mqttTopic = 44; 314 | string mqttMassage = 45 ; 315 | 316 | } 317 | 318 | /// Did the commend succeeded (true) or not (false) 319 | message CommendStatus { 320 | bool success = 5; 321 | } 322 | 323 | message SmartDeviceUpdateDetails { 324 | SmartDeviceInfo smartDevice = 6; 325 | string newName = 7; 326 | } 327 | 328 | message FirebaseAccountInformation { 329 | string fireBaseProjectId = 8; 330 | string fireBaseApiKey = 9; 331 | string userEmail = 10; 332 | string userPassword = 11; 333 | string homeId = 12; 334 | } 335 | 336 | message DeviceTypesActions { 337 | VendorsAndServices vendorsAndServices = 46; 338 | DeviceTypes deviceType = 35; 339 | DeviceActions deviceAction = 36; 340 | DeviceStateGRPC deviceStateGRPC = 37; 341 | } 342 | -------------------------------------------------------------------------------- /.idea/cbj_smart-home.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /ProtoFiles/protos/aioesphomeapi/api.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "aioesphomeapi/api_options.proto"; 4 | 5 | service APIConnection { 6 | rpc hello (HelloRequest) returns (HelloResponse) { 7 | option (needs_setup_connection) = false; 8 | option (needs_authentication) = false; 9 | } 10 | rpc connect (ConnectRequest) returns (ConnectResponse) { 11 | option (needs_setup_connection) = false; 12 | option (needs_authentication) = false; 13 | } 14 | rpc disconnect (DisconnectRequest) returns (DisconnectResponse) { 15 | option (needs_setup_connection) = false; 16 | option (needs_authentication) = false; 17 | } 18 | rpc ping (PingRequest) returns (PingResponse) { 19 | option (needs_setup_connection) = false; 20 | option (needs_authentication) = false; 21 | } 22 | rpc device_info (DeviceInfoRequest) returns (DeviceInfoResponse) { 23 | option (needs_authentication) = false; 24 | } 25 | rpc list_entities (ListEntitiesRequest) returns (void) {} 26 | rpc subscribe_states (SubscribeStatesRequest) returns (void) {} 27 | rpc subscribe_logs (SubscribeLogsRequest) returns (void) {} 28 | rpc subscribe_homeassistant_services (SubscribeHomeassistantServicesRequest) returns (void) {} 29 | rpc subscribe_home_assistant_states (SubscribeHomeAssistantStatesRequest) returns (void) {} 30 | rpc get_time (GetTimeRequest) returns (GetTimeResponse) { 31 | option (needs_authentication) = false; 32 | } 33 | rpc execute_service (ExecuteServiceRequest) returns (void) {} 34 | 35 | rpc cover_command (CoverCommandRequest) returns (void) {} 36 | rpc fan_command (FanCommandRequest) returns (void) {} 37 | rpc light_command (LightCommandRequest) returns (void) {} 38 | rpc switch_command (SwitchCommandRequest) returns (void) {} 39 | rpc camera_image (CameraImageRequest) returns (void) {} 40 | rpc climate_command (ClimateCommandRequest) returns (void) {} 41 | rpc number_command (NumberCommandRequest) returns (void) {} 42 | } 43 | 44 | 45 | // ==================== BASE PACKETS ==================== 46 | 47 | // The Home Assistant protocol is structured as a simple 48 | // TCP socket with short binary messages encoded in the protocol buffers format 49 | // First, a message in this protocol has a specific format: 50 | // * A zero byte. 51 | // * VarInt denoting the size of the message object. (type is not part of this) 52 | // * VarInt denoting the type of message. 53 | // * The message object encoded as a ProtoBuf message 54 | 55 | // The connection is established in 4 steps: 56 | // * First, the client connects to the server and sends a "Hello Request" identifying itself 57 | // * The server responds with a "Hello Response" and selects the protocol version 58 | // * After receiving this message, the client attempts to authenticate itself using 59 | // the password and a "Connect Request" 60 | // * The server responds with a "Connect Response" and notifies of invalid password. 61 | // If anything in this initial process fails, the connection must immediately closed 62 | // by both sides and _no_ disconnection message is to be sent. 63 | 64 | // Message sent at the beginning of each connection 65 | // Can only be sent by the client and only at the beginning of the connection 66 | message HelloRequest { 67 | option (id) = 1; 68 | option (source) = SOURCE_CLIENT; 69 | option (no_delay) = true; 70 | 71 | // Description of client (like User Agent) 72 | // For example "Home Assistant" 73 | // Not strictly necessary to send but nice for debugging 74 | // purposes. 75 | string client_info = 1; 76 | } 77 | 78 | // Confirmation of successful connection request. 79 | // Can only be sent by the server and only at the beginning of the connection 80 | message HelloResponse { 81 | option (id) = 2; 82 | option (source) = SOURCE_SERVER; 83 | option (no_delay) = true; 84 | 85 | // The version of the API to use. The _client_ (for example Home Assistant) needs to check 86 | // for compatibility and if necessary adopt to an older API. 87 | // Major is for breaking changes in the base protocol - a mismatch will lead to immediate disconnect_client_ 88 | // Minor is for breaking changes in individual messages - a mismatch will lead to a warning message 89 | uint32 api_version_major = 1; 90 | uint32 api_version_minor = 2; 91 | 92 | // A string identifying the server (ESP); like client info this may be empty 93 | // and only exists for debugging/logging purposes. 94 | // For example "ESPHome v1.10.0 on ESP8266" 95 | string server_info = 3; 96 | } 97 | 98 | // Message sent at the beginning of each connection to authenticate the client 99 | // Can only be sent by the client and only at the beginning of the connection 100 | message ConnectRequest { 101 | option (id) = 3; 102 | option (source) = SOURCE_CLIENT; 103 | option (no_delay) = true; 104 | 105 | // The password to log in with 106 | string password = 1; 107 | } 108 | 109 | // Confirmation of successful connection. After this the connection is available for all traffic. 110 | // Can only be sent by the server and only at the beginning of the connection 111 | message ConnectResponse { 112 | option (id) = 4; 113 | option (source) = SOURCE_SERVER; 114 | option (no_delay) = true; 115 | 116 | bool invalid_password = 1; 117 | } 118 | 119 | // Request to close the connection. 120 | // Can be sent by both the client and server 121 | message DisconnectRequest { 122 | option (id) = 5; 123 | option (source) = SOURCE_BOTH; 124 | option (no_delay) = true; 125 | 126 | // Do not close the connection before the acknowledgement arrives 127 | } 128 | 129 | message DisconnectResponse { 130 | option (id) = 6; 131 | option (source) = SOURCE_BOTH; 132 | option (no_delay) = true; 133 | 134 | // Empty - Both parties are required to close the connection after this 135 | // message has been received. 136 | } 137 | 138 | message PingRequest { 139 | option (id) = 7; 140 | option (source) = SOURCE_BOTH; 141 | // Empty 142 | } 143 | 144 | message PingResponse { 145 | option (id) = 8; 146 | option (source) = SOURCE_BOTH; 147 | // Empty 148 | } 149 | 150 | message DeviceInfoRequest { 151 | option (id) = 9; 152 | option (source) = SOURCE_CLIENT; 153 | // Empty 154 | } 155 | 156 | message DeviceInfoResponse { 157 | option (id) = 10; 158 | option (source) = SOURCE_SERVER; 159 | 160 | bool uses_password = 1; 161 | 162 | // The name of the node, given by "App.set_name()" 163 | string name = 2; 164 | 165 | // The mac address of the device. For example "AC:BC:32:89:0E:A9" 166 | string mac_address = 3; 167 | 168 | // A string describing the ESPHome version. For example "1.10.0" 169 | string esphome_version = 4; 170 | 171 | // A string describing the date of compilation, this is generated by the compiler 172 | // and therefore may not be in the same format all the time. 173 | // If the user isn't using ESPHome, this will also not be set. 174 | string compilation_time = 5; 175 | 176 | // The model of the board. For example NodeMCU 177 | string model = 6; 178 | 179 | bool has_deep_sleep = 7; 180 | 181 | // The esphome project details if set 182 | string project_name = 8; 183 | string project_version = 9; 184 | } 185 | 186 | message ListEntitiesRequest { 187 | option (id) = 11; 188 | option (source) = SOURCE_CLIENT; 189 | // Empty 190 | } 191 | message ListEntitiesDoneResponse { 192 | option (id) = 19; 193 | option (source) = SOURCE_SERVER; 194 | option (no_delay) = true; 195 | // Empty 196 | } 197 | message SubscribeStatesRequest { 198 | option (id) = 20; 199 | option (source) = SOURCE_CLIENT; 200 | // Empty 201 | } 202 | 203 | // ==================== BINARY SENSOR ==================== 204 | message ListEntitiesBinarySensorResponse { 205 | option (id) = 12; 206 | option (source) = SOURCE_SERVER; 207 | option (ifdef) = "USE_BINARY_SENSOR"; 208 | 209 | string object_id = 1; 210 | fixed32 key = 2; 211 | string name = 3; 212 | string unique_id = 4; 213 | 214 | string device_class = 5; 215 | bool is_status_binary_sensor = 6; 216 | } 217 | message BinarySensorStateResponse { 218 | option (id) = 21; 219 | option (source) = SOURCE_SERVER; 220 | option (ifdef) = "USE_BINARY_SENSOR"; 221 | option (no_delay) = true; 222 | 223 | fixed32 key = 1; 224 | bool state = 2; 225 | // If the binary sensor does not have a valid state yet. 226 | // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller 227 | bool missing_state = 3; 228 | } 229 | 230 | // ==================== COVER ==================== 231 | message ListEntitiesCoverResponse { 232 | option (id) = 13; 233 | option (source) = SOURCE_SERVER; 234 | option (ifdef) = "USE_COVER"; 235 | 236 | string object_id = 1; 237 | fixed32 key = 2; 238 | string name = 3; 239 | string unique_id = 4; 240 | 241 | bool assumed_state = 5; 242 | bool supports_position = 6; 243 | bool supports_tilt = 7; 244 | string device_class = 8; 245 | } 246 | 247 | enum LegacyCoverState { 248 | LEGACY_COVER_STATE_OPEN = 0; 249 | LEGACY_COVER_STATE_CLOSED = 1; 250 | } 251 | enum CoverOperation { 252 | COVER_OPERATION_IDLE = 0; 253 | COVER_OPERATION_IS_OPENING = 1; 254 | COVER_OPERATION_IS_CLOSING = 2; 255 | } 256 | message CoverStateResponse { 257 | option (id) = 22; 258 | option (source) = SOURCE_SERVER; 259 | option (ifdef) = "USE_COVER"; 260 | option (no_delay) = true; 261 | 262 | fixed32 key = 1; 263 | // legacy: state has been removed in 1.13 264 | // clients/servers must still send/accept it until the next protocol change 265 | LegacyCoverState legacy_state = 2; 266 | 267 | float position = 3; 268 | float tilt = 4; 269 | CoverOperation current_operation = 5; 270 | } 271 | 272 | enum LegacyCoverCommand { 273 | LEGACY_COVER_COMMAND_OPEN = 0; 274 | LEGACY_COVER_COMMAND_CLOSE = 1; 275 | LEGACY_COVER_COMMAND_STOP = 2; 276 | } 277 | message CoverCommandRequest { 278 | option (id) = 30; 279 | option (source) = SOURCE_CLIENT; 280 | option (ifdef) = "USE_COVER"; 281 | option (no_delay) = true; 282 | 283 | fixed32 key = 1; 284 | 285 | // legacy: command has been removed in 1.13 286 | // clients/servers must still send/accept it until the next protocol change 287 | bool has_legacy_command = 2; 288 | LegacyCoverCommand legacy_command = 3; 289 | 290 | bool has_position = 4; 291 | float position = 5; 292 | bool has_tilt = 6; 293 | float tilt = 7; 294 | bool stop = 8; 295 | } 296 | 297 | // ==================== FAN ==================== 298 | message ListEntitiesFanResponse { 299 | option (id) = 14; 300 | option (source) = SOURCE_SERVER; 301 | option (ifdef) = "USE_FAN"; 302 | 303 | string object_id = 1; 304 | fixed32 key = 2; 305 | string name = 3; 306 | string unique_id = 4; 307 | 308 | bool supports_oscillation = 5; 309 | bool supports_speed = 6; 310 | bool supports_direction = 7; 311 | int32 supported_speed_levels = 8; 312 | } 313 | enum FanSpeed { 314 | FAN_SPEED_LOW = 0; 315 | FAN_SPEED_MEDIUM = 1; 316 | FAN_SPEED_HIGH = 2; 317 | } 318 | enum FanDirection { 319 | FAN_DIRECTION_FORWARD = 0; 320 | FAN_DIRECTION_REVERSE = 1; 321 | } 322 | message FanStateResponse { 323 | option (id) = 23; 324 | option (source) = SOURCE_SERVER; 325 | option (ifdef) = "USE_FAN"; 326 | option (no_delay) = true; 327 | 328 | fixed32 key = 1; 329 | bool state = 2; 330 | bool oscillating = 3; 331 | FanSpeed speed = 4 [deprecated = true]; 332 | FanDirection direction = 5; 333 | int32 speed_level = 6; 334 | } 335 | message FanCommandRequest { 336 | option (id) = 31; 337 | option (source) = SOURCE_CLIENT; 338 | option (ifdef) = "USE_FAN"; 339 | option (no_delay) = true; 340 | 341 | fixed32 key = 1; 342 | bool has_state = 2; 343 | bool state = 3; 344 | bool has_speed = 4 [deprecated = true]; 345 | FanSpeed speed = 5 [deprecated = true]; 346 | bool has_oscillating = 6; 347 | bool oscillating = 7; 348 | bool has_direction = 8; 349 | FanDirection direction = 9; 350 | bool has_speed_level = 10; 351 | int32 speed_level = 11; 352 | } 353 | 354 | // ==================== LIGHT ==================== 355 | message ListEntitiesLightResponse { 356 | option (id) = 15; 357 | option (source) = SOURCE_SERVER; 358 | option (ifdef) = "USE_LIGHT"; 359 | 360 | string object_id = 1; 361 | fixed32 key = 2; 362 | string name = 3; 363 | string unique_id = 4; 364 | 365 | bool supports_brightness = 5; 366 | bool supports_rgb = 6; 367 | bool supports_white_value = 7; 368 | bool supports_color_temperature = 8; 369 | float min_mireds = 9; 370 | float max_mireds = 10; 371 | repeated string effects = 11; 372 | } 373 | message LightStateResponse { 374 | option (id) = 24; 375 | option (source) = SOURCE_SERVER; 376 | option (ifdef) = "USE_LIGHT"; 377 | option (no_delay) = true; 378 | 379 | fixed32 key = 1; 380 | bool state = 2; 381 | float brightness = 3; 382 | float red = 4; 383 | float green = 5; 384 | float blue = 6; 385 | float white = 7; 386 | float color_temperature = 8; 387 | string effect = 9; 388 | } 389 | message LightCommandRequest { 390 | option (id) = 32; 391 | option (source) = SOURCE_CLIENT; 392 | option (ifdef) = "USE_LIGHT"; 393 | option (no_delay) = true; 394 | 395 | fixed32 key = 1; 396 | bool has_state = 2; 397 | bool state = 3; 398 | bool has_brightness = 4; 399 | float brightness = 5; 400 | bool has_rgb = 6; 401 | float red = 7; 402 | float green = 8; 403 | float blue = 9; 404 | bool has_white = 10; 405 | float white = 11; 406 | bool has_color_temperature = 12; 407 | float color_temperature = 13; 408 | bool has_transition_length = 14; 409 | uint32 transition_length = 15; 410 | bool has_flash_length = 16; 411 | uint32 flash_length = 17; 412 | bool has_effect = 18; 413 | string effect = 19; 414 | } 415 | 416 | // ==================== SENSOR ==================== 417 | enum SensorStateClass { 418 | STATE_CLASS_NONE = 0; 419 | STATE_CLASS_MEASUREMENT = 1; 420 | } 421 | 422 | message ListEntitiesSensorResponse { 423 | option (id) = 16; 424 | option (source) = SOURCE_SERVER; 425 | option (ifdef) = "USE_SENSOR"; 426 | 427 | string object_id = 1; 428 | fixed32 key = 2; 429 | string name = 3; 430 | string unique_id = 4; 431 | 432 | string icon = 5; 433 | string unit_of_measurement = 6; 434 | int32 accuracy_decimals = 7; 435 | bool force_update = 8; 436 | string device_class = 9; 437 | SensorStateClass state_class = 10; 438 | } 439 | message SensorStateResponse { 440 | option (id) = 25; 441 | option (source) = SOURCE_SERVER; 442 | option (ifdef) = "USE_SENSOR"; 443 | option (no_delay) = true; 444 | 445 | fixed32 key = 1; 446 | float state = 2; 447 | // If the sensor does not have a valid state yet. 448 | // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller 449 | bool missing_state = 3; 450 | } 451 | 452 | // ==================== SWITCH ==================== 453 | message ListEntitiesSwitchResponse { 454 | option (id) = 17; 455 | option (source) = SOURCE_SERVER; 456 | option (ifdef) = "USE_SWITCH"; 457 | 458 | string object_id = 1; 459 | fixed32 key = 2; 460 | string name = 3; 461 | string unique_id = 4; 462 | 463 | string icon = 5; 464 | bool assumed_state = 6; 465 | } 466 | message SwitchStateResponse { 467 | option (id) = 26; 468 | option (source) = SOURCE_SERVER; 469 | option (ifdef) = "USE_SWITCH"; 470 | option (no_delay) = true; 471 | 472 | fixed32 key = 1; 473 | bool state = 2; 474 | } 475 | message SwitchCommandRequest { 476 | option (id) = 33; 477 | option (source) = SOURCE_CLIENT; 478 | option (ifdef) = "USE_SWITCH"; 479 | option (no_delay) = true; 480 | 481 | fixed32 key = 1; 482 | bool state = 2; 483 | } 484 | 485 | // ==================== TEXT SENSOR ==================== 486 | message ListEntitiesTextSensorResponse { 487 | option (id) = 18; 488 | option (source) = SOURCE_SERVER; 489 | option (ifdef) = "USE_TEXT_SENSOR"; 490 | 491 | string object_id = 1; 492 | fixed32 key = 2; 493 | string name = 3; 494 | string unique_id = 4; 495 | 496 | string icon = 5; 497 | } 498 | message TextSensorStateResponse { 499 | option (id) = 27; 500 | option (source) = SOURCE_SERVER; 501 | option (ifdef) = "USE_TEXT_SENSOR"; 502 | option (no_delay) = true; 503 | 504 | fixed32 key = 1; 505 | string state = 2; 506 | // If the text sensor does not have a valid state yet. 507 | // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller 508 | bool missing_state = 3; 509 | } 510 | 511 | // ==================== SUBSCRIBE LOGS ==================== 512 | enum LogLevel { 513 | LOG_LEVEL_NONE = 0; 514 | LOG_LEVEL_ERROR = 1; 515 | LOG_LEVEL_WARN = 2; 516 | LOG_LEVEL_INFO = 3; 517 | LOG_LEVEL_DEBUG = 4; 518 | LOG_LEVEL_VERBOSE = 5; 519 | LOG_LEVEL_VERY_VERBOSE = 6; 520 | } 521 | message SubscribeLogsRequest { 522 | option (id) = 28; 523 | option (source) = SOURCE_CLIENT; 524 | LogLevel level = 1; 525 | bool dump_config = 2; 526 | } 527 | message SubscribeLogsResponse { 528 | option (id) = 29; 529 | option (source) = SOURCE_SERVER; 530 | option (log) = false; 531 | option (no_delay) = false; 532 | 533 | LogLevel level = 1; 534 | string tag = 2; 535 | string message = 3; 536 | bool send_failed = 4; 537 | } 538 | 539 | // ==================== HOMEASSISTANT.SERVICE ==================== 540 | message SubscribeHomeassistantServicesRequest { 541 | option (id) = 34; 542 | option (source) = SOURCE_CLIENT; 543 | } 544 | 545 | message HomeassistantServiceMap { 546 | string key = 1; 547 | string value = 2; 548 | } 549 | 550 | message HomeassistantServiceResponse { 551 | option (id) = 35; 552 | option (source) = SOURCE_SERVER; 553 | option (no_delay) = true; 554 | 555 | string service = 1; 556 | repeated HomeassistantServiceMap data = 2; 557 | repeated HomeassistantServiceMap data_template = 3; 558 | repeated HomeassistantServiceMap variables = 4; 559 | bool is_event = 5; 560 | } 561 | 562 | // ==================== IMPORT HOME ASSISTANT STATES ==================== 563 | // 1. Client sends SubscribeHomeAssistantStatesRequest 564 | // 2. Server responds with zero or more SubscribeHomeAssistantStateResponse (async) 565 | // 3. Client sends HomeAssistantStateResponse for state changes. 566 | message SubscribeHomeAssistantStatesRequest { 567 | option (id) = 38; 568 | option (source) = SOURCE_CLIENT; 569 | } 570 | 571 | message SubscribeHomeAssistantStateResponse { 572 | option (id) = 39; 573 | option (source) = SOURCE_SERVER; 574 | string entity_id = 1; 575 | string attribute = 2; 576 | } 577 | 578 | message HomeAssistantStateResponse { 579 | option (id) = 40; 580 | option (source) = SOURCE_CLIENT; 581 | option (no_delay) = true; 582 | 583 | string entity_id = 1; 584 | string state = 2; 585 | string attribute = 3; 586 | } 587 | 588 | // ==================== IMPORT TIME ==================== 589 | message GetTimeRequest { 590 | option (id) = 36; 591 | option (source) = SOURCE_BOTH; 592 | } 593 | 594 | message GetTimeResponse { 595 | option (id) = 37; 596 | option (source) = SOURCE_BOTH; 597 | option (no_delay) = true; 598 | 599 | fixed32 epoch_seconds = 1; 600 | } 601 | 602 | // ==================== USER-DEFINES SERVICES ==================== 603 | enum ServiceArgType { 604 | SERVICE_ARG_TYPE_BOOL = 0; 605 | SERVICE_ARG_TYPE_INT = 1; 606 | SERVICE_ARG_TYPE_FLOAT = 2; 607 | SERVICE_ARG_TYPE_STRING = 3; 608 | SERVICE_ARG_TYPE_BOOL_ARRAY = 4; 609 | SERVICE_ARG_TYPE_INT_ARRAY = 5; 610 | SERVICE_ARG_TYPE_FLOAT_ARRAY = 6; 611 | SERVICE_ARG_TYPE_STRING_ARRAY = 7; 612 | } 613 | message ListEntitiesServicesArgument { 614 | string name = 1; 615 | ServiceArgType type = 2; 616 | } 617 | message ListEntitiesServicesResponse { 618 | option (id) = 41; 619 | option (source) = SOURCE_SERVER; 620 | 621 | string name = 1; 622 | fixed32 key = 2; 623 | repeated ListEntitiesServicesArgument args = 3; 624 | } 625 | message ExecuteServiceArgument { 626 | bool bool_ = 1; 627 | int32 legacy_int = 2; 628 | float float_ = 3; 629 | string string_ = 4; 630 | // ESPHome 1.14 (api v1.3) make int a signed value 631 | sint32 int_ = 5; 632 | repeated bool bool_array = 6 [packed=false]; 633 | repeated sint32 int_array = 7 [packed=false]; 634 | repeated float float_array = 8 [packed=false]; 635 | repeated string string_array = 9; 636 | } 637 | message ExecuteServiceRequest { 638 | option (id) = 42; 639 | option (source) = SOURCE_CLIENT; 640 | option (no_delay) = true; 641 | 642 | fixed32 key = 1; 643 | repeated ExecuteServiceArgument args = 2; 644 | } 645 | 646 | // ==================== CAMERA ==================== 647 | message ListEntitiesCameraResponse { 648 | option (id) = 43; 649 | option (source) = SOURCE_SERVER; 650 | option (ifdef) = "USE_ESP32_CAMERA"; 651 | 652 | string object_id = 1; 653 | fixed32 key = 2; 654 | string name = 3; 655 | string unique_id = 4; 656 | } 657 | 658 | message CameraImageResponse { 659 | option (id) = 44; 660 | option (source) = SOURCE_SERVER; 661 | option (ifdef) = "USE_ESP32_CAMERA"; 662 | 663 | fixed32 key = 1; 664 | bytes data = 2; 665 | bool done = 3; 666 | } 667 | message CameraImageRequest { 668 | option (id) = 45; 669 | option (source) = SOURCE_CLIENT; 670 | option (ifdef) = "USE_ESP32_CAMERA"; 671 | option (no_delay) = true; 672 | 673 | bool single = 1; 674 | bool stream = 2; 675 | } 676 | 677 | // ==================== CLIMATE ==================== 678 | enum ClimateMode { 679 | CLIMATE_MODE_OFF = 0; 680 | CLIMATE_MODE_HEAT_COOL = 1; 681 | CLIMATE_MODE_COOL = 2; 682 | CLIMATE_MODE_HEAT = 3; 683 | CLIMATE_MODE_FAN_ONLY = 4; 684 | CLIMATE_MODE_DRY = 5; 685 | CLIMATE_MODE_AUTO = 6; 686 | } 687 | enum ClimateFanMode { 688 | CLIMATE_FAN_ON = 0; 689 | CLIMATE_FAN_OFF = 1; 690 | CLIMATE_FAN_AUTO = 2; 691 | CLIMATE_FAN_LOW = 3; 692 | CLIMATE_FAN_MEDIUM = 4; 693 | CLIMATE_FAN_HIGH = 5; 694 | CLIMATE_FAN_MIDDLE = 6; 695 | CLIMATE_FAN_FOCUS = 7; 696 | CLIMATE_FAN_DIFFUSE = 8; 697 | } 698 | enum ClimateSwingMode { 699 | CLIMATE_SWING_OFF = 0; 700 | CLIMATE_SWING_BOTH = 1; 701 | CLIMATE_SWING_VERTICAL = 2; 702 | CLIMATE_SWING_HORIZONTAL = 3; 703 | } 704 | enum ClimateAction { 705 | CLIMATE_ACTION_OFF = 0; 706 | // values same as mode for readability 707 | CLIMATE_ACTION_COOLING = 2; 708 | CLIMATE_ACTION_HEATING = 3; 709 | CLIMATE_ACTION_IDLE = 4; 710 | CLIMATE_ACTION_DRYING = 5; 711 | CLIMATE_ACTION_FAN = 6; 712 | } 713 | enum ClimatePreset { 714 | CLIMATE_PRESET_NONE = 0; 715 | CLIMATE_PRESET_HOME = 1; 716 | CLIMATE_PRESET_AWAY = 2; 717 | CLIMATE_PRESET_BOOST = 3; 718 | CLIMATE_PRESET_COMFORT = 4; 719 | CLIMATE_PRESET_ECO = 5; 720 | CLIMATE_PRESET_SLEEP = 6; 721 | CLIMATE_PRESET_ACTIVITY = 7; 722 | } 723 | message ListEntitiesClimateResponse { 724 | option (id) = 46; 725 | option (source) = SOURCE_SERVER; 726 | option (ifdef) = "USE_CLIMATE"; 727 | 728 | string object_id = 1; 729 | fixed32 key = 2; 730 | string name = 3; 731 | string unique_id = 4; 732 | 733 | bool supports_current_temperature = 5; 734 | bool supports_two_point_target_temperature = 6; 735 | repeated ClimateMode supported_modes = 7; 736 | float visual_min_temperature = 8; 737 | float visual_max_temperature = 9; 738 | float visual_temperature_step = 10; 739 | // for older peer versions - in new system this 740 | // is if CLIMATE_PRESET_AWAY exists is supported_presets 741 | bool legacy_supports_away = 11; 742 | bool supports_action = 12; 743 | repeated ClimateFanMode supported_fan_modes = 13; 744 | repeated ClimateSwingMode supported_swing_modes = 14; 745 | repeated string supported_custom_fan_modes = 15; 746 | repeated ClimatePreset supported_presets = 16; 747 | repeated string supported_custom_presets = 17; 748 | } 749 | message ClimateStateResponse { 750 | option (id) = 47; 751 | option (source) = SOURCE_SERVER; 752 | option (ifdef) = "USE_CLIMATE"; 753 | option (no_delay) = true; 754 | 755 | fixed32 key = 1; 756 | ClimateMode mode = 2; 757 | float current_temperature = 3; 758 | float target_temperature = 4; 759 | float target_temperature_low = 5; 760 | float target_temperature_high = 6; 761 | // For older peers, equal to preset == CLIMATE_PRESET_AWAY 762 | bool legacy_away = 7; 763 | ClimateAction action = 8; 764 | ClimateFanMode fan_mode = 9; 765 | ClimateSwingMode swing_mode = 10; 766 | string custom_fan_mode = 11; 767 | ClimatePreset preset = 12; 768 | string custom_preset = 13; 769 | } 770 | message ClimateCommandRequest { 771 | option (id) = 48; 772 | option (source) = SOURCE_CLIENT; 773 | option (ifdef) = "USE_CLIMATE"; 774 | option (no_delay) = true; 775 | 776 | fixed32 key = 1; 777 | bool has_mode = 2; 778 | ClimateMode mode = 3; 779 | bool has_target_temperature = 4; 780 | float target_temperature = 5; 781 | bool has_target_temperature_low = 6; 782 | float target_temperature_low = 7; 783 | bool has_target_temperature_high = 8; 784 | float target_temperature_high = 9; 785 | // legacy, for older peers, newer ones should use CLIMATE_PRESET_AWAY in preset 786 | bool has_legacy_away = 10; 787 | bool legacy_away = 11; 788 | bool has_fan_mode = 12; 789 | ClimateFanMode fan_mode = 13; 790 | bool has_swing_mode = 14; 791 | ClimateSwingMode swing_mode = 15; 792 | bool has_custom_fan_mode = 16; 793 | string custom_fan_mode = 17; 794 | bool has_preset = 18; 795 | ClimatePreset preset = 19; 796 | bool has_custom_preset = 20; 797 | string custom_preset = 21; 798 | } 799 | 800 | // ==================== NUMBER ==================== 801 | message ListEntitiesNumberResponse { 802 | option (id) = 49; 803 | option (source) = SOURCE_SERVER; 804 | option (ifdef) = "USE_NUMBER"; 805 | 806 | string object_id = 1; 807 | fixed32 key = 2; 808 | string name = 3; 809 | string unique_id = 4; 810 | 811 | string icon = 5; 812 | float min_value = 6; 813 | float max_value = 7; 814 | float step = 8; 815 | } 816 | message NumberStateResponse { 817 | option (id) = 50; 818 | option (source) = SOURCE_SERVER; 819 | option (ifdef) = "USE_NUMBER"; 820 | option (no_delay) = true; 821 | 822 | fixed32 key = 1; 823 | float state = 2; 824 | // If the number does not have a valid state yet. 825 | // Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller 826 | bool missing_state = 3; 827 | } 828 | message NumberCommandRequest { 829 | option (id) = 51; 830 | option (source) = SOURCE_CLIENT; 831 | option (ifdef) = "USE_NUMBER"; 832 | option (no_delay) = true; 833 | 834 | fixed32 key = 1; 835 | float state = 2; 836 | } 837 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 24 | 25 | 26 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 72 | 73 | 74 | 75 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 109 | 110 | 114 | 115 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 1629738367772 135 | 140 | 141 | 142 | 1629754120656 143 | 147 | 148 | 1629831728962 149 | 154 | 155 | 1629903662660 156 | 161 | 162 | 1630183596194 163 | 168 | 169 | 1633766165418 170 | 175 | 176 | 1633766397895 177 | 182 | 183 | 1635694505977 184 | 189 | 190 | 1635694728032 191 | 196 | 197 | 1637229097001 198 | 203 | 204 | 1637229265573 205 | 210 | 211 | 1637231550462 212 | 217 | 218 | 1637238164413 219 | 224 | 225 | 1637243814121 226 | 231 | 232 | 1637245258480 233 | 238 | 239 | 1637259018707 240 | 245 | 246 | 1637259760488 247 | 252 | 253 | 1637312507570 254 | 259 | 260 | 1637931815107 261 | 266 | 267 | 1638783819326 268 | 273 | 274 | 1639316781341 275 | 280 | 281 | 1639317644359 282 | 287 | 288 | 1659015671555 289 | 294 | 295 | 1665167852068 296 | 301 | 302 | 1665167962448 303 | 308 | 309 | 1665174608848 310 | 315 | 316 | 1665174618999 317 | 322 | 323 | 1665315950885 324 | 329 | 330 | 1665317630554 331 | 336 | 337 | 1665644409270 338 | 343 | 344 | 1665688357858 345 | 350 | 351 | 1665688940158 352 | 357 | 360 | 361 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 415 | 416 | 417 | 418 | 419 | file://$PROJECT_DIR$/cbj_hub/lib/infrastructure/devices/cbj_devices/cbj_devices_connector_conjector.dart 420 | 50 421 | 423 | 424 | file://$PROJECT_DIR$/cbj_hub/lib/infrastructure/devices/cbj_devices/cbj_devices_helpers.dart 425 | 37 426 | 428 | 429 | file://$PROJECT_DIR$/cbj_app/lib/infrastructure/hub_client/hub_requests_routing.dart 430 | 207 431 | 433 | 434 | file://$PROJECT_DIR$/cbj_app/lib/presentation/device_full_screen_page/smart_computers/widgets/room_smart_computers.dart 435 | 37 436 | 438 | 439 | file://$PROJECT_DIR$/cbj_app/lib/presentation/device_full_screen_page/smart_computers/widgets/room_smart_computers.dart 440 | 107 441 | 443 | 444 | file://$PROJECT_DIR$/cbj_app/lib/presentation/device_full_screen_page/smart_computers/widgets/room_smart_computers.dart 445 | 167 446 | 448 | 449 | file://$PROJECT_DIR$/cbj_hub/lib/infrastructure/devices/cbj_devices/cbj_smart_device/cbj_smart_device_entity.dart 450 | 78 451 | 453 | 454 | file://$PROJECT_DIR$/cbj_hub/lib/infrastructure/devices/cbj_devices/cbj_smart_device/cbj_smart_device_entity.dart 455 | 43 456 | 458 | 459 | file://$PROJECT_DIR$/cbj_smart-device/lib/application/usecases/smart_server_u/smart_server_u.dart 460 | 459 461 | 463 | 464 | 465 | 466 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------