aiorainpoint 0.1.0__py3-none-any.whl
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.
- aiorainpoint/__init__.py +157 -0
- aiorainpoint/certs/ali_iot_ca.crt +24 -0
- aiorainpoint/client.py +930 -0
- aiorainpoint/data/product_catalog.json +6411 -0
- aiorainpoint/decoders.py +1775 -0
- aiorainpoint/generic_decoder.py +475 -0
- aiorainpoint/models.py +103 -0
- aiorainpoint/mqtt.py +1155 -0
- aiorainpoint/product_catalog.py +268 -0
- aiorainpoint/py.typed +0 -0
- aiorainpoint/trust.py +66 -0
- aiorainpoint/utils.py +705 -0
- aiorainpoint/validators.py +98 -0
- aiorainpoint-0.1.0.dist-info/METADATA +57 -0
- aiorainpoint-0.1.0.dist-info/RECORD +17 -0
- aiorainpoint-0.1.0.dist-info/WHEEL +4 -0
- aiorainpoint-0.1.0.dist-info/licenses/LICENSE +22 -0
aiorainpoint/__init__.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""
|
|
2
|
+
RainPoint API module.
|
|
3
|
+
|
|
4
|
+
Re-exports the client, the per-model decoders, the catalog lookups and the
|
|
5
|
+
helpers the integration uses, so callers import all of them from one place.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .client import RainPointApiError, RainPointClient, RainPointError, RainPointThrottledError
|
|
9
|
+
from .decoders import (
|
|
10
|
+
SINGLE_OUTLET_GALLONS_PER_COUNT,
|
|
11
|
+
USAGE_GALLONS_PER_COUNT,
|
|
12
|
+
decode_co2,
|
|
13
|
+
decode_display,
|
|
14
|
+
decode_flow_meter,
|
|
15
|
+
decode_flowmeter, # Alias for backward compatibility
|
|
16
|
+
decode_hcs005frf,
|
|
17
|
+
decode_hcs014arf,
|
|
18
|
+
decode_hcs015arf,
|
|
19
|
+
decode_hcs024frf_v1,
|
|
20
|
+
decode_hcs044frf,
|
|
21
|
+
decode_hcs0528arf,
|
|
22
|
+
decode_hic801w,
|
|
23
|
+
decode_htv145frf,
|
|
24
|
+
decode_htv210b,
|
|
25
|
+
decode_htv210b_dp_state,
|
|
26
|
+
decode_htv213frf_valve,
|
|
27
|
+
decode_hws019wrf_v2,
|
|
28
|
+
decode_moisture_full,
|
|
29
|
+
decode_moisture_simple,
|
|
30
|
+
decode_packed_timestamp,
|
|
31
|
+
decode_pool,
|
|
32
|
+
decode_pool_plus,
|
|
33
|
+
decode_rain,
|
|
34
|
+
decode_soil,
|
|
35
|
+
decode_temp_hum,
|
|
36
|
+
decode_temp_hum_full,
|
|
37
|
+
decode_temphum,
|
|
38
|
+
decode_unknown,
|
|
39
|
+
decode_valve_hub,
|
|
40
|
+
)
|
|
41
|
+
from .generic_decoder import decode_generic, is_ascii_declined
|
|
42
|
+
from .product_catalog import (
|
|
43
|
+
get_catalog_entry,
|
|
44
|
+
get_catalog_fingerprint,
|
|
45
|
+
get_catalog_port_number,
|
|
46
|
+
get_catalog_variant_codes,
|
|
47
|
+
)
|
|
48
|
+
from .trust import has_bluetooth_control_identity, is_hand_written_model
|
|
49
|
+
from .utils import (
|
|
50
|
+
_base_decoder_dict,
|
|
51
|
+
_extract_report_time,
|
|
52
|
+
_is_dp_id_framed,
|
|
53
|
+
_le16,
|
|
54
|
+
_parse_rainpoint_payload,
|
|
55
|
+
_parse_tlv_payload,
|
|
56
|
+
_RecordSummary,
|
|
57
|
+
_redact_identifier,
|
|
58
|
+
_redact_secret,
|
|
59
|
+
_safe_key,
|
|
60
|
+
decode_packed_report_time,
|
|
61
|
+
encode_dp_duration_param,
|
|
62
|
+
f10_to_c,
|
|
63
|
+
is_ascii_payload,
|
|
64
|
+
parse_entries,
|
|
65
|
+
parse_hub_broadcast_flag,
|
|
66
|
+
parse_sub_power_mode,
|
|
67
|
+
splice_hub_broadcast_param,
|
|
68
|
+
splice_sub_power_mode,
|
|
69
|
+
split_prefix,
|
|
70
|
+
summarize_record,
|
|
71
|
+
valid_rssi_dbm,
|
|
72
|
+
)
|
|
73
|
+
from .validators import (
|
|
74
|
+
_extract_battery_flag,
|
|
75
|
+
_extract_rssi,
|
|
76
|
+
_validate_payload,
|
|
77
|
+
_validate_tag,
|
|
78
|
+
battery_flag_is_low,
|
|
79
|
+
battery_flag_to_percent,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
__all__ = [
|
|
83
|
+
# Decoder constants
|
|
84
|
+
"SINGLE_OUTLET_GALLONS_PER_COUNT",
|
|
85
|
+
"USAGE_GALLONS_PER_COUNT",
|
|
86
|
+
# Client
|
|
87
|
+
"RainPointApiError",
|
|
88
|
+
"RainPointClient",
|
|
89
|
+
"RainPointError",
|
|
90
|
+
"RainPointThrottledError",
|
|
91
|
+
"_RecordSummary",
|
|
92
|
+
# Utils and decoder helpers
|
|
93
|
+
"_base_decoder_dict",
|
|
94
|
+
"_extract_battery_flag",
|
|
95
|
+
"_extract_report_time",
|
|
96
|
+
"_extract_rssi",
|
|
97
|
+
"_is_dp_id_framed",
|
|
98
|
+
"_le16",
|
|
99
|
+
"_parse_rainpoint_payload",
|
|
100
|
+
"_parse_tlv_payload",
|
|
101
|
+
"_redact_identifier",
|
|
102
|
+
"_redact_secret",
|
|
103
|
+
"_safe_key",
|
|
104
|
+
"_validate_payload",
|
|
105
|
+
"_validate_tag",
|
|
106
|
+
"battery_flag_is_low",
|
|
107
|
+
"battery_flag_to_percent",
|
|
108
|
+
# Decoders
|
|
109
|
+
"decode_co2",
|
|
110
|
+
"decode_display",
|
|
111
|
+
"decode_flow_meter",
|
|
112
|
+
"decode_flowmeter", # Alias for backward compatibility
|
|
113
|
+
"decode_generic",
|
|
114
|
+
"decode_hcs005frf",
|
|
115
|
+
"decode_hcs014arf",
|
|
116
|
+
"decode_hcs015arf",
|
|
117
|
+
"decode_hcs024frf_v1",
|
|
118
|
+
"decode_hcs044frf",
|
|
119
|
+
"decode_hcs0528arf",
|
|
120
|
+
"decode_hic801w",
|
|
121
|
+
"decode_htv145frf",
|
|
122
|
+
"decode_htv210b",
|
|
123
|
+
"decode_htv210b_dp_state",
|
|
124
|
+
"decode_htv213frf_valve",
|
|
125
|
+
"decode_hws019wrf_v2",
|
|
126
|
+
"decode_moisture_full",
|
|
127
|
+
"decode_moisture_simple",
|
|
128
|
+
"decode_packed_report_time",
|
|
129
|
+
"decode_packed_timestamp",
|
|
130
|
+
"decode_pool",
|
|
131
|
+
"decode_pool_plus",
|
|
132
|
+
"decode_rain",
|
|
133
|
+
"decode_soil",
|
|
134
|
+
"decode_temp_hum",
|
|
135
|
+
"decode_temp_hum_full",
|
|
136
|
+
"decode_temphum",
|
|
137
|
+
"decode_unknown",
|
|
138
|
+
"decode_valve_hub",
|
|
139
|
+
"encode_dp_duration_param",
|
|
140
|
+
"f10_to_c",
|
|
141
|
+
"get_catalog_entry",
|
|
142
|
+
"get_catalog_fingerprint",
|
|
143
|
+
"get_catalog_port_number",
|
|
144
|
+
"get_catalog_variant_codes",
|
|
145
|
+
"has_bluetooth_control_identity",
|
|
146
|
+
"is_ascii_declined",
|
|
147
|
+
"is_ascii_payload",
|
|
148
|
+
"is_hand_written_model",
|
|
149
|
+
"parse_entries",
|
|
150
|
+
"parse_hub_broadcast_flag",
|
|
151
|
+
"parse_sub_power_mode",
|
|
152
|
+
"splice_hub_broadcast_param",
|
|
153
|
+
"splice_sub_power_mode",
|
|
154
|
+
"split_prefix",
|
|
155
|
+
"summarize_record",
|
|
156
|
+
"valid_rssi_dbm",
|
|
157
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIID3zCCAsegAwIBAgISfiX6mTa5RMUTGSC3rQhnestIMA0GCSqGSIb3DQEBCwUA
|
|
3
|
+
MHcxCzAJBgNVBAYTAkNOMREwDwYDVQQIDAhaaGVqaWFuZzERMA8GA1UEBwwISGFu
|
|
4
|
+
Z3pob3UxEzARBgNVBAoMCkFsaXl1biBJb1QxEDAOBgNVBAsMB1Jvb3QgQ0ExGzAZ
|
|
5
|
+
B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