esphome-ts 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/client.js +7 -7
- package/dist/api/connection.js +6 -6
- package/dist/api/espDevice.js +11 -11
- package/dist/api/espSocket.js +5 -5
- package/dist/api/helpers.js +14 -14
- package/dist/api/index.js +5 -1
- package/dist/api/interfaces.d.ts +3 -3
- package/dist/api/protobuf/api.d.ts +53 -53
- package/dist/api/protobuf/api_options.d.ts +3 -3
- package/dist/api/protobuf/google_descriptor.d.ts +29 -29
- package/dist/api/protobuf/google_descriptor.js +5 -21
- package/dist/api/socket.js +13 -13
- package/dist/components/base.js +5 -5
- package/dist/components/entities.d.ts +1 -1
- package/dist/components/index.js +5 -1
- package/dist/components/light.js +6 -6
- package/dist/components/states.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/run.js +4 -4
- package/package.json +27 -26
- package/CHANGELOG.md +0 -32
|
@@ -828,195 +828,195 @@ export interface GeneratedCodeInfo_Annotation {
|
|
|
828
828
|
}
|
|
829
829
|
export declare const FileDescriptorSet: {
|
|
830
830
|
encode(message: FileDescriptorSet, writer?: Writer): Writer;
|
|
831
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
831
|
+
decode(input: Reader | Uint8Array, length?: number): FileDescriptorSet;
|
|
832
832
|
fromJSON(object: any): FileDescriptorSet;
|
|
833
833
|
toJSON(message: FileDescriptorSet): unknown;
|
|
834
834
|
fromPartial(object: DeepPartial<FileDescriptorSet>): FileDescriptorSet;
|
|
835
835
|
};
|
|
836
836
|
export declare const FileDescriptorProto: {
|
|
837
837
|
encode(message: FileDescriptorProto, writer?: Writer): Writer;
|
|
838
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
838
|
+
decode(input: Reader | Uint8Array, length?: number): FileDescriptorProto;
|
|
839
839
|
fromJSON(object: any): FileDescriptorProto;
|
|
840
840
|
toJSON(message: FileDescriptorProto): unknown;
|
|
841
841
|
fromPartial(object: DeepPartial<FileDescriptorProto>): FileDescriptorProto;
|
|
842
842
|
};
|
|
843
843
|
export declare const DescriptorProto: {
|
|
844
844
|
encode(message: DescriptorProto, writer?: Writer): Writer;
|
|
845
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
845
|
+
decode(input: Reader | Uint8Array, length?: number): DescriptorProto;
|
|
846
846
|
fromJSON(object: any): DescriptorProto;
|
|
847
847
|
toJSON(message: DescriptorProto): unknown;
|
|
848
848
|
fromPartial(object: DeepPartial<DescriptorProto>): DescriptorProto;
|
|
849
849
|
};
|
|
850
850
|
export declare const DescriptorProto_ExtensionRange: {
|
|
851
851
|
encode(message: DescriptorProto_ExtensionRange, writer?: Writer): Writer;
|
|
852
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
852
|
+
decode(input: Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange;
|
|
853
853
|
fromJSON(object: any): DescriptorProto_ExtensionRange;
|
|
854
854
|
toJSON(message: DescriptorProto_ExtensionRange): unknown;
|
|
855
855
|
fromPartial(object: DeepPartial<DescriptorProto_ExtensionRange>): DescriptorProto_ExtensionRange;
|
|
856
856
|
};
|
|
857
857
|
export declare const DescriptorProto_ReservedRange: {
|
|
858
858
|
encode(message: DescriptorProto_ReservedRange, writer?: Writer): Writer;
|
|
859
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
859
|
+
decode(input: Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange;
|
|
860
860
|
fromJSON(object: any): DescriptorProto_ReservedRange;
|
|
861
861
|
toJSON(message: DescriptorProto_ReservedRange): unknown;
|
|
862
862
|
fromPartial(object: DeepPartial<DescriptorProto_ReservedRange>): DescriptorProto_ReservedRange;
|
|
863
863
|
};
|
|
864
864
|
export declare const ExtensionRangeOptions: {
|
|
865
865
|
encode(message: ExtensionRangeOptions, writer?: Writer): Writer;
|
|
866
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
866
|
+
decode(input: Reader | Uint8Array, length?: number): ExtensionRangeOptions;
|
|
867
867
|
fromJSON(object: any): ExtensionRangeOptions;
|
|
868
868
|
toJSON(message: ExtensionRangeOptions): unknown;
|
|
869
869
|
fromPartial(object: DeepPartial<ExtensionRangeOptions>): ExtensionRangeOptions;
|
|
870
870
|
};
|
|
871
871
|
export declare const FieldDescriptorProto: {
|
|
872
872
|
encode(message: FieldDescriptorProto, writer?: Writer): Writer;
|
|
873
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
873
|
+
decode(input: Reader | Uint8Array, length?: number): FieldDescriptorProto;
|
|
874
874
|
fromJSON(object: any): FieldDescriptorProto;
|
|
875
875
|
toJSON(message: FieldDescriptorProto): unknown;
|
|
876
876
|
fromPartial(object: DeepPartial<FieldDescriptorProto>): FieldDescriptorProto;
|
|
877
877
|
};
|
|
878
878
|
export declare const OneofDescriptorProto: {
|
|
879
879
|
encode(message: OneofDescriptorProto, writer?: Writer): Writer;
|
|
880
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
880
|
+
decode(input: Reader | Uint8Array, length?: number): OneofDescriptorProto;
|
|
881
881
|
fromJSON(object: any): OneofDescriptorProto;
|
|
882
882
|
toJSON(message: OneofDescriptorProto): unknown;
|
|
883
883
|
fromPartial(object: DeepPartial<OneofDescriptorProto>): OneofDescriptorProto;
|
|
884
884
|
};
|
|
885
885
|
export declare const EnumDescriptorProto: {
|
|
886
886
|
encode(message: EnumDescriptorProto, writer?: Writer): Writer;
|
|
887
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
887
|
+
decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto;
|
|
888
888
|
fromJSON(object: any): EnumDescriptorProto;
|
|
889
889
|
toJSON(message: EnumDescriptorProto): unknown;
|
|
890
890
|
fromPartial(object: DeepPartial<EnumDescriptorProto>): EnumDescriptorProto;
|
|
891
891
|
};
|
|
892
892
|
export declare const EnumDescriptorProto_EnumReservedRange: {
|
|
893
893
|
encode(message: EnumDescriptorProto_EnumReservedRange, writer?: Writer): Writer;
|
|
894
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
894
|
+
decode(input: Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange;
|
|
895
895
|
fromJSON(object: any): EnumDescriptorProto_EnumReservedRange;
|
|
896
896
|
toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown;
|
|
897
897
|
fromPartial(object: DeepPartial<EnumDescriptorProto_EnumReservedRange>): EnumDescriptorProto_EnumReservedRange;
|
|
898
898
|
};
|
|
899
899
|
export declare const EnumValueDescriptorProto: {
|
|
900
900
|
encode(message: EnumValueDescriptorProto, writer?: Writer): Writer;
|
|
901
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
901
|
+
decode(input: Reader | Uint8Array, length?: number): EnumValueDescriptorProto;
|
|
902
902
|
fromJSON(object: any): EnumValueDescriptorProto;
|
|
903
903
|
toJSON(message: EnumValueDescriptorProto): unknown;
|
|
904
904
|
fromPartial(object: DeepPartial<EnumValueDescriptorProto>): EnumValueDescriptorProto;
|
|
905
905
|
};
|
|
906
906
|
export declare const ServiceDescriptorProto: {
|
|
907
907
|
encode(message: ServiceDescriptorProto, writer?: Writer): Writer;
|
|
908
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
908
|
+
decode(input: Reader | Uint8Array, length?: number): ServiceDescriptorProto;
|
|
909
909
|
fromJSON(object: any): ServiceDescriptorProto;
|
|
910
910
|
toJSON(message: ServiceDescriptorProto): unknown;
|
|
911
911
|
fromPartial(object: DeepPartial<ServiceDescriptorProto>): ServiceDescriptorProto;
|
|
912
912
|
};
|
|
913
913
|
export declare const MethodDescriptorProto: {
|
|
914
914
|
encode(message: MethodDescriptorProto, writer?: Writer): Writer;
|
|
915
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
915
|
+
decode(input: Reader | Uint8Array, length?: number): MethodDescriptorProto;
|
|
916
916
|
fromJSON(object: any): MethodDescriptorProto;
|
|
917
917
|
toJSON(message: MethodDescriptorProto): unknown;
|
|
918
918
|
fromPartial(object: DeepPartial<MethodDescriptorProto>): MethodDescriptorProto;
|
|
919
919
|
};
|
|
920
920
|
export declare const FileOptions: {
|
|
921
921
|
encode(message: FileOptions, writer?: Writer): Writer;
|
|
922
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
922
|
+
decode(input: Reader | Uint8Array, length?: number): FileOptions;
|
|
923
923
|
fromJSON(object: any): FileOptions;
|
|
924
924
|
toJSON(message: FileOptions): unknown;
|
|
925
925
|
fromPartial(object: DeepPartial<FileOptions>): FileOptions;
|
|
926
926
|
};
|
|
927
927
|
export declare const MessageOptions: {
|
|
928
928
|
encode(message: MessageOptions, writer?: Writer): Writer;
|
|
929
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
929
|
+
decode(input: Reader | Uint8Array, length?: number): MessageOptions;
|
|
930
930
|
fromJSON(object: any): MessageOptions;
|
|
931
931
|
toJSON(message: MessageOptions): unknown;
|
|
932
932
|
fromPartial(object: DeepPartial<MessageOptions>): MessageOptions;
|
|
933
933
|
};
|
|
934
934
|
export declare const FieldOptions: {
|
|
935
935
|
encode(message: FieldOptions, writer?: Writer): Writer;
|
|
936
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
936
|
+
decode(input: Reader | Uint8Array, length?: number): FieldOptions;
|
|
937
937
|
fromJSON(object: any): FieldOptions;
|
|
938
938
|
toJSON(message: FieldOptions): unknown;
|
|
939
939
|
fromPartial(object: DeepPartial<FieldOptions>): FieldOptions;
|
|
940
940
|
};
|
|
941
941
|
export declare const OneofOptions: {
|
|
942
942
|
encode(message: OneofOptions, writer?: Writer): Writer;
|
|
943
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
943
|
+
decode(input: Reader | Uint8Array, length?: number): OneofOptions;
|
|
944
944
|
fromJSON(object: any): OneofOptions;
|
|
945
945
|
toJSON(message: OneofOptions): unknown;
|
|
946
946
|
fromPartial(object: DeepPartial<OneofOptions>): OneofOptions;
|
|
947
947
|
};
|
|
948
948
|
export declare const EnumOptions: {
|
|
949
949
|
encode(message: EnumOptions, writer?: Writer): Writer;
|
|
950
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
950
|
+
decode(input: Reader | Uint8Array, length?: number): EnumOptions;
|
|
951
951
|
fromJSON(object: any): EnumOptions;
|
|
952
952
|
toJSON(message: EnumOptions): unknown;
|
|
953
953
|
fromPartial(object: DeepPartial<EnumOptions>): EnumOptions;
|
|
954
954
|
};
|
|
955
955
|
export declare const EnumValueOptions: {
|
|
956
956
|
encode(message: EnumValueOptions, writer?: Writer): Writer;
|
|
957
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
957
|
+
decode(input: Reader | Uint8Array, length?: number): EnumValueOptions;
|
|
958
958
|
fromJSON(object: any): EnumValueOptions;
|
|
959
959
|
toJSON(message: EnumValueOptions): unknown;
|
|
960
960
|
fromPartial(object: DeepPartial<EnumValueOptions>): EnumValueOptions;
|
|
961
961
|
};
|
|
962
962
|
export declare const ServiceOptions: {
|
|
963
963
|
encode(message: ServiceOptions, writer?: Writer): Writer;
|
|
964
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
964
|
+
decode(input: Reader | Uint8Array, length?: number): ServiceOptions;
|
|
965
965
|
fromJSON(object: any): ServiceOptions;
|
|
966
966
|
toJSON(message: ServiceOptions): unknown;
|
|
967
967
|
fromPartial(object: DeepPartial<ServiceOptions>): ServiceOptions;
|
|
968
968
|
};
|
|
969
969
|
export declare const MethodOptions: {
|
|
970
970
|
encode(message: MethodOptions, writer?: Writer): Writer;
|
|
971
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
971
|
+
decode(input: Reader | Uint8Array, length?: number): MethodOptions;
|
|
972
972
|
fromJSON(object: any): MethodOptions;
|
|
973
973
|
toJSON(message: MethodOptions): unknown;
|
|
974
974
|
fromPartial(object: DeepPartial<MethodOptions>): MethodOptions;
|
|
975
975
|
};
|
|
976
976
|
export declare const UninterpretedOption: {
|
|
977
977
|
encode(message: UninterpretedOption, writer?: Writer): Writer;
|
|
978
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
978
|
+
decode(input: Reader | Uint8Array, length?: number): UninterpretedOption;
|
|
979
979
|
fromJSON(object: any): UninterpretedOption;
|
|
980
980
|
toJSON(message: UninterpretedOption): unknown;
|
|
981
981
|
fromPartial(object: DeepPartial<UninterpretedOption>): UninterpretedOption;
|
|
982
982
|
};
|
|
983
983
|
export declare const UninterpretedOption_NamePart: {
|
|
984
984
|
encode(message: UninterpretedOption_NamePart, writer?: Writer): Writer;
|
|
985
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
985
|
+
decode(input: Reader | Uint8Array, length?: number): UninterpretedOption_NamePart;
|
|
986
986
|
fromJSON(object: any): UninterpretedOption_NamePart;
|
|
987
987
|
toJSON(message: UninterpretedOption_NamePart): unknown;
|
|
988
988
|
fromPartial(object: DeepPartial<UninterpretedOption_NamePart>): UninterpretedOption_NamePart;
|
|
989
989
|
};
|
|
990
990
|
export declare const SourceCodeInfo: {
|
|
991
991
|
encode(message: SourceCodeInfo, writer?: Writer): Writer;
|
|
992
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
992
|
+
decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo;
|
|
993
993
|
fromJSON(object: any): SourceCodeInfo;
|
|
994
994
|
toJSON(message: SourceCodeInfo): unknown;
|
|
995
995
|
fromPartial(object: DeepPartial<SourceCodeInfo>): SourceCodeInfo;
|
|
996
996
|
};
|
|
997
997
|
export declare const SourceCodeInfo_Location: {
|
|
998
998
|
encode(message: SourceCodeInfo_Location, writer?: Writer): Writer;
|
|
999
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
999
|
+
decode(input: Reader | Uint8Array, length?: number): SourceCodeInfo_Location;
|
|
1000
1000
|
fromJSON(object: any): SourceCodeInfo_Location;
|
|
1001
1001
|
toJSON(message: SourceCodeInfo_Location): unknown;
|
|
1002
1002
|
fromPartial(object: DeepPartial<SourceCodeInfo_Location>): SourceCodeInfo_Location;
|
|
1003
1003
|
};
|
|
1004
1004
|
export declare const GeneratedCodeInfo: {
|
|
1005
1005
|
encode(message: GeneratedCodeInfo, writer?: Writer): Writer;
|
|
1006
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
1006
|
+
decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo;
|
|
1007
1007
|
fromJSON(object: any): GeneratedCodeInfo;
|
|
1008
1008
|
toJSON(message: GeneratedCodeInfo): unknown;
|
|
1009
1009
|
fromPartial(object: DeepPartial<GeneratedCodeInfo>): GeneratedCodeInfo;
|
|
1010
1010
|
};
|
|
1011
1011
|
export declare const GeneratedCodeInfo_Annotation: {
|
|
1012
1012
|
encode(message: GeneratedCodeInfo_Annotation, writer?: Writer): Writer;
|
|
1013
|
-
decode(input: Reader | Uint8Array, length?: number
|
|
1013
|
+
decode(input: Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation;
|
|
1014
1014
|
fromJSON(object: any): GeneratedCodeInfo_Annotation;
|
|
1015
1015
|
toJSON(message: GeneratedCodeInfo_Annotation): unknown;
|
|
1016
1016
|
fromPartial(object: DeepPartial<GeneratedCodeInfo_Annotation>): GeneratedCodeInfo_Annotation;
|
|
1017
1017
|
};
|
|
1018
|
-
|
|
1019
|
-
export
|
|
1018
|
+
type Builtin = Date | Function | Uint8Array | string | number | undefined;
|
|
1019
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
1020
1020
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
1021
1021
|
} : Partial<T>;
|
|
1022
1022
|
export {};
|
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
4
|
};
|
|
21
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
6
|
exports.GeneratedCodeInfo_Annotation = exports.GeneratedCodeInfo = exports.SourceCodeInfo_Location = exports.SourceCodeInfo = exports.UninterpretedOption_NamePart = exports.UninterpretedOption = exports.MethodOptions = exports.ServiceOptions = exports.EnumValueOptions = exports.EnumOptions = exports.OneofOptions = exports.FieldOptions = exports.MessageOptions = exports.FileOptions = exports.MethodDescriptorProto = exports.ServiceDescriptorProto = exports.EnumValueDescriptorProto = exports.EnumDescriptorProto_EnumReservedRange = exports.EnumDescriptorProto = exports.OneofDescriptorProto = exports.FieldDescriptorProto = exports.ExtensionRangeOptions = exports.DescriptorProto_ReservedRange = exports.DescriptorProto_ExtensionRange = exports.DescriptorProto = exports.FileDescriptorProto = exports.FileDescriptorSet = exports.methodOptions_IdempotencyLevelToJSON = exports.methodOptions_IdempotencyLevelFromJSON = exports.MethodOptions_IdempotencyLevel = exports.fieldOptions_JSTypeToJSON = exports.fieldOptions_JSTypeFromJSON = exports.FieldOptions_JSType = exports.fieldOptions_CTypeToJSON = exports.fieldOptions_CTypeFromJSON = exports.FieldOptions_CType = exports.fileOptions_OptimizeModeToJSON = exports.fileOptions_OptimizeModeFromJSON = exports.FileOptions_OptimizeMode = exports.fieldDescriptorProto_LabelToJSON = exports.fieldDescriptorProto_LabelFromJSON = exports.FieldDescriptorProto_Label = exports.fieldDescriptorProto_TypeToJSON = exports.fieldDescriptorProto_TypeFromJSON = exports.FieldDescriptorProto_Type = exports.protobufPackage = void 0;
|
|
23
7
|
/* eslint-disable */
|
|
24
|
-
const
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
25
9
|
const minimal_1 = require("protobufjs/minimal");
|
|
26
10
|
exports.protobufPackage = 'google.protobuf';
|
|
27
11
|
var FieldDescriptorProto_Type;
|
|
@@ -3992,5 +3976,5 @@ function longToNumber(long) {
|
|
|
3992
3976
|
}
|
|
3993
3977
|
return long.toNumber();
|
|
3994
3978
|
}
|
|
3995
|
-
minimal_1.util.Long =
|
|
3996
|
-
minimal_1.configure();
|
|
3979
|
+
minimal_1.util.Long = long_1.default;
|
|
3980
|
+
(0, minimal_1.configure)();
|
package/dist/api/socket.js
CHANGED
|
@@ -66,31 +66,31 @@ class RxjsSocket {
|
|
|
66
66
|
if (!this.socket) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
rxjs_1.fromEvent(this.socket, 'error')
|
|
70
|
-
.pipe(operators_1.tap((err) => this.error.next(err)), operators_1.takeUntil(this.terminate))
|
|
69
|
+
(0, rxjs_1.fromEvent)(this.socket, 'error')
|
|
70
|
+
.pipe((0, operators_1.tap)((err) => this.error.next(err)), (0, operators_1.takeUntil)(this.terminate))
|
|
71
71
|
.subscribe();
|
|
72
|
-
rxjs_1.fromEvent(this.socket, 'data')
|
|
73
|
-
.pipe(operators_1.tap((buffer) => this.data.next(buffer)), operators_1.takeUntil(this.terminate))
|
|
72
|
+
(0, rxjs_1.fromEvent)(this.socket, 'data')
|
|
73
|
+
.pipe((0, operators_1.tap)((buffer) => this.data.next(buffer)), (0, operators_1.takeUntil)(this.terminate))
|
|
74
74
|
.subscribe();
|
|
75
|
-
rxjs_1.fromEvent(this.socket, 'connect')
|
|
76
|
-
.pipe(operators_1.take(1), operators_1.tap(() => this.connected.next(true)), operators_1.takeUntil(this.terminate))
|
|
75
|
+
(0, rxjs_1.fromEvent)(this.socket, 'connect')
|
|
76
|
+
.pipe((0, operators_1.take)(1), (0, operators_1.tap)(() => this.connected.next(true)), (0, operators_1.takeUntil)(this.terminate))
|
|
77
77
|
.subscribe();
|
|
78
|
-
rxjs_1.fromEvent(this.socket, 'close')
|
|
79
|
-
.pipe(operators_1.take(1), operators_1.tap(() => this.connected.next(false)), operators_1.takeUntil(this.terminate))
|
|
78
|
+
(0, rxjs_1.fromEvent)(this.socket, 'close')
|
|
79
|
+
.pipe((0, operators_1.take)(1), (0, operators_1.tap)(() => this.connected.next(false)), (0, operators_1.takeUntil)(this.terminate))
|
|
80
80
|
.subscribe();
|
|
81
|
-
rxjs_1.fromEvent(this.socket, 'end')
|
|
82
|
-
.pipe(operators_1.take(1), operators_1.tap(() => { var _a; return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.end(); }), operators_1.tap(() => this.connected.next(false)), operators_1.takeUntil(this.terminate))
|
|
81
|
+
(0, rxjs_1.fromEvent)(this.socket, 'end')
|
|
82
|
+
.pipe((0, operators_1.take)(1), (0, operators_1.tap)(() => { var _a; return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.end(); }), (0, operators_1.tap)(() => this.connected.next(false)), (0, operators_1.takeUntil)(this.terminate))
|
|
83
83
|
.subscribe();
|
|
84
84
|
if (this.config.timeout && this.config.timeout > 0) {
|
|
85
|
-
rxjs_1.fromEvent(this.socket, 'timeout')
|
|
86
|
-
.pipe(operators_1.tap(() => this.timeout.next()), operators_1.tap(() => {
|
|
85
|
+
(0, rxjs_1.fromEvent)(this.socket, 'timeout')
|
|
86
|
+
.pipe((0, operators_1.tap)(() => this.timeout.next()), (0, operators_1.tap)(() => {
|
|
87
87
|
if (this.config.disconnectOnTimeout) {
|
|
88
88
|
this.destroySocket();
|
|
89
89
|
}
|
|
90
90
|
if (this.config.reconnectOnTimeout) {
|
|
91
91
|
this.reconnect();
|
|
92
92
|
}
|
|
93
|
-
}), operators_1.takeUntil(this.terminate))
|
|
93
|
+
}), (0, operators_1.takeUntil)(this.terminate))
|
|
94
94
|
.subscribe();
|
|
95
95
|
}
|
|
96
96
|
}
|
package/dist/components/base.js
CHANGED
|
@@ -12,16 +12,16 @@ class BaseComponent {
|
|
|
12
12
|
this.terminatePreviousStateSubscription = new rxjs_1.Subject();
|
|
13
13
|
this.teardown = new rxjs_1.Subject();
|
|
14
14
|
this.commandInPipeline = new rxjs_1.BehaviorSubject(false);
|
|
15
|
-
this.state$ = this.state.pipe(operators_1.filter((state) => state !== undefined));
|
|
15
|
+
this.state$ = this.state.pipe((0, operators_1.filter)((state) => state !== undefined));
|
|
16
16
|
this.provideStateObservable(state);
|
|
17
17
|
this.commandInPipeline
|
|
18
|
-
.pipe(operators_1.debounceTime(30 * 1000), operators_1.filter(api_1.isTrue), operators_1.tap(() => this.commandInPipeline.next(false)), operators_1.takeUntil(this.teardown))
|
|
18
|
+
.pipe((0, operators_1.debounceTime)(30 * 1000), (0, operators_1.filter)(api_1.isTrue), (0, operators_1.tap)(() => this.commandInPipeline.next(false)), (0, operators_1.takeUntil)(this.teardown))
|
|
19
19
|
.subscribe();
|
|
20
20
|
}
|
|
21
21
|
provideStateObservable(state$) {
|
|
22
22
|
this.terminatePreviousStateSubscription.next();
|
|
23
23
|
state$
|
|
24
|
-
.pipe(operators_1.tap((state) => this.state.next(state)), operators_1.tap(() => this.commandInPipeline.next(false)), operators_1.takeUntil(this.terminatePreviousStateSubscription), operators_1.takeUntil(this.teardown))
|
|
24
|
+
.pipe((0, operators_1.tap)((state) => this.state.next(state)), (0, operators_1.tap)(() => this.commandInPipeline.next(false)), (0, operators_1.takeUntil)(this.terminatePreviousStateSubscription), (0, operators_1.takeUntil)(this.teardown))
|
|
25
25
|
.subscribe();
|
|
26
26
|
}
|
|
27
27
|
get ready() {
|
|
@@ -41,10 +41,10 @@ class BaseComponent {
|
|
|
41
41
|
}
|
|
42
42
|
queueCommand(type, dataFn, disableSerialise = false) {
|
|
43
43
|
this.commandInPipeline
|
|
44
|
-
.pipe(operators_1.filter((x) => !x || disableSerialise), operators_1.take(1), operators_1.tap(() => {
|
|
44
|
+
.pipe((0, operators_1.filter)((x) => !x || disableSerialise), (0, operators_1.take)(1), (0, operators_1.tap)(() => {
|
|
45
45
|
this.commandInterface.sendEspMessage(type, dataFn());
|
|
46
46
|
this.commandInPipeline.next(true);
|
|
47
|
-
}), operators_1.takeUntil(this.teardown))
|
|
47
|
+
}), (0, operators_1.takeUntil)(this.teardown))
|
|
48
48
|
.subscribe();
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -18,4 +18,4 @@ export interface LightEntity extends ListEntity {
|
|
|
18
18
|
supportsBrightness: boolean;
|
|
19
19
|
supportsRgb: boolean;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type ComponentType = 'light' | 'binarySensor' | 'sensor' | 'switch';
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/components/light.js
CHANGED
|
@@ -23,7 +23,7 @@ class LightComponent extends base_1.BaseComponent {
|
|
|
23
23
|
return this.hsv.value;
|
|
24
24
|
}
|
|
25
25
|
else if (this.listEntity.supportsBrightness) {
|
|
26
|
-
return helpers_1.convertNumbers(state.brightness, 100, true);
|
|
26
|
+
return (0, helpers_1.convertNumbers)(state.brightness, 100, true);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
setBrightness(brightness) {
|
|
@@ -36,7 +36,7 @@ class LightComponent extends base_1.BaseComponent {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
else if (this.listEntity.supportsBrightness) {
|
|
39
|
-
const bright = helpers_1.convertNumbers(brightness, 100, false);
|
|
39
|
+
const bright = (0, helpers_1.convertNumbers)(brightness, 100, false);
|
|
40
40
|
const state = this.generateState(1);
|
|
41
41
|
state.brightness = bright;
|
|
42
42
|
this.queueCommand(api_2.MessageTypes.LightCommandRequest, () => api_1.LightCommandRequest.encode(state).finish());
|
|
@@ -65,10 +65,10 @@ class LightComponent extends base_1.BaseComponent {
|
|
|
65
65
|
}
|
|
66
66
|
const [red, green, blue] = color_convert_1.hsv.rgb([hsv.hue, hsv.saturation, 100]);
|
|
67
67
|
const newState = {
|
|
68
|
-
red: helpers_1.convertNumbers(red, 255, false),
|
|
69
|
-
green: helpers_1.convertNumbers(green, 255, false),
|
|
70
|
-
blue: helpers_1.convertNumbers(blue, 255, false),
|
|
71
|
-
brightness: helpers_1.convertNumbers(hsv.value, 100, false),
|
|
68
|
+
red: (0, helpers_1.convertNumbers)(red, 255, false),
|
|
69
|
+
green: (0, helpers_1.convertNumbers)(green, 255, false),
|
|
70
|
+
blue: (0, helpers_1.convertNumbers)(blue, 255, false),
|
|
71
|
+
brightness: (0, helpers_1.convertNumbers)(hsv.value, 100, false),
|
|
72
72
|
};
|
|
73
73
|
this.queueCommand(api_2.MessageTypes.LightCommandRequest, () => api_1.LightCommandRequest.encode(Object.assign(this.generateState(1), newState)).finish());
|
|
74
74
|
}
|
|
@@ -7,7 +7,7 @@ export interface SensorStateEvent extends StateEvent {
|
|
|
7
7
|
export interface BinarySensorStateEvent extends StateEvent {
|
|
8
8
|
state?: boolean;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type SwitchStateEvent = BinarySensorStateEvent;
|
|
11
11
|
export interface LightStateEvent extends StateEvent {
|
|
12
12
|
state?: boolean;
|
|
13
13
|
brightness?: number;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/run.js
CHANGED
|
@@ -4,14 +4,14 @@ const operators_1 = require("rxjs/operators");
|
|
|
4
4
|
const api_1 = require("./api");
|
|
5
5
|
const device = new api_1.EspDevice('172.16.0.112');
|
|
6
6
|
device.discovery$
|
|
7
|
-
.pipe(operators_1.filter(api_1.isTrue), operators_1.take(1), operators_1.tap(() => {
|
|
7
|
+
.pipe((0, operators_1.filter)(api_1.isTrue), (0, operators_1.take)(1), (0, operators_1.tap)(() => {
|
|
8
8
|
const kitchenLights = device.components['kitchen_lights:'];
|
|
9
9
|
const livingRoomDehumidifier = device.components['living_room_dehumidifier'];
|
|
10
10
|
console.log(livingRoomDehumidifier.name);
|
|
11
|
-
if (api_1.isSwitchComponent(livingRoomDehumidifier)) {
|
|
12
|
-
livingRoomDehumidifier.state$.pipe(operators_1.tap(console.log)).subscribe();
|
|
11
|
+
if ((0, api_1.isSwitchComponent)(livingRoomDehumidifier)) {
|
|
12
|
+
livingRoomDehumidifier.state$.pipe((0, operators_1.tap)(console.log)).subscribe();
|
|
13
13
|
livingRoomDehumidifier.turnOff();
|
|
14
14
|
}
|
|
15
15
|
}))
|
|
16
16
|
.subscribe();
|
|
17
|
-
device.alive$.pipe(operators_1.tap((val) => console.log('alive', val))).subscribe();
|
|
17
|
+
device.alive$.pipe((0, operators_1.tap)((val) => console.log('alive', val))).subscribe();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esphome-ts",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "A TypeScript client for the Esphome Native API interface",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,34 +30,35 @@
|
|
|
30
30
|
"license": "GPL-3.0",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"color-convert": "2.0.1",
|
|
33
|
-
"protobufjs": "
|
|
34
|
-
|
|
33
|
+
"protobufjs": "7.2.3"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"rxjs": "^7.8.1"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
|
-
"@commitlint/cli": "
|
|
38
|
-
"@commitlint/config-conventional": "
|
|
39
|
-
"@semantic-release/changelog": "
|
|
40
|
-
"@semantic-release/git": "
|
|
39
|
+
"@commitlint/cli": "17.6.3",
|
|
40
|
+
"@commitlint/config-conventional": "17.6.3",
|
|
41
|
+
"@semantic-release/changelog": "6.0.3",
|
|
42
|
+
"@semantic-release/git": "10.0.1",
|
|
41
43
|
"@types/color-convert": "2.0.0",
|
|
42
|
-
"@types/jest": "
|
|
43
|
-
"@types/node": "
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/
|
|
46
|
-
"
|
|
47
|
-
"eslint": "7.28.0",
|
|
44
|
+
"@types/jest": "28.1.8",
|
|
45
|
+
"@types/node": "20.1.2",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "5.59.5",
|
|
47
|
+
"@typescript-eslint/parser": "5.59.5",
|
|
48
|
+
"eslint": "8.40.0",
|
|
48
49
|
"eslint-config-google": "0.14.0",
|
|
49
|
-
"eslint-config-prettier": "8.
|
|
50
|
-
"eslint-plugin-import": "2.
|
|
51
|
-
"eslint-plugin-prettier": "
|
|
52
|
-
"eslint-plugin-unused-imports": "
|
|
53
|
-
"jest": "
|
|
54
|
-
"jest-junit": "
|
|
55
|
-
"prettier": "2.
|
|
56
|
-
"prettier-eslint": "
|
|
57
|
-
"semantic-release": "
|
|
58
|
-
"ts-jest": "
|
|
59
|
-
"ts-node-dev": "
|
|
60
|
-
"ts-proto": "1.
|
|
61
|
-
"typescript": "
|
|
50
|
+
"eslint-config-prettier": "8.8.0",
|
|
51
|
+
"eslint-plugin-import": "2.27.5",
|
|
52
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
53
|
+
"eslint-plugin-unused-imports": "2.0.0",
|
|
54
|
+
"jest": "28.1.3",
|
|
55
|
+
"jest-junit": "16.0.0",
|
|
56
|
+
"prettier": "2.8.8",
|
|
57
|
+
"prettier-eslint": "15.0.1",
|
|
58
|
+
"semantic-release": "21.0.2",
|
|
59
|
+
"ts-jest": "28.0.8",
|
|
60
|
+
"ts-node-dev": "2.0.0",
|
|
61
|
+
"ts-proto": "1.147.2",
|
|
62
|
+
"typescript": "5.0.4"
|
|
62
63
|
}
|
|
63
64
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# [3.3.0](https://github.com/lucavb/esphome-ts/compare/v3.2.0...v3.3.0) (2021-06-10)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Features
|
|
5
|
-
|
|
6
|
-
* release deviceClass ([56a8244](https://github.com/lucavb/esphome-ts/commit/56a8244c5f62c98066155fa61626c1e0be68a165))
|
|
7
|
-
|
|
8
|
-
# [3.2.0](https://github.com/lucavb/esphome-ts/compare/v3.1.1...v3.2.0) (2021-06-08)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Features
|
|
12
|
-
|
|
13
|
-
* **deps:** rxjs@7 release commit ([32ccd14](https://github.com/lucavb/esphome-ts/commit/32ccd14caedec692479c950c94d6e71cf0c4d73e))
|
|
14
|
-
|
|
15
|
-
## [3.1.1](https://github.com/lucavb/esphome-ts/compare/v3.1.0...v3.1.1) (2021-04-05)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
* **api:** exchanging wrong interface / no longer decoding per default coverstate ([f4a82ba](https://github.com/lucavb/esphome-ts/commit/f4a82ba1f371f4299a7f89dbb522656f95c4018d))
|
|
21
|
-
|
|
22
|
-
# [3.1.0](https://github.com/lucavb/esphome-ts/compare/v3.0.5...v3.1.0) (2021-03-07)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Bug Fixes
|
|
26
|
-
|
|
27
|
-
* **test:** updating typeguard ([10238e6](https://github.com/lucavb/esphome-ts/commit/10238e6790034ead36b8b6a7f58571317a3a3368))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### Features
|
|
31
|
-
|
|
32
|
-
* **protobuf:** updating proto definitions ([5567a97](https://github.com/lucavb/esphome-ts/commit/5567a9788fa811e14ff6b5f0fce5197a57c1bd85))
|