boneIO 0.3.0.dev9__tar.gz → 0.4.0.dev1__tar.gz

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.
Files changed (77) hide show
  1. boneIO-0.4.0.dev1/PKG-INFO +35 -0
  2. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/const.py +2 -3
  3. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/cover.py +2 -1
  4. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/example_config/output24x16A.yaml +2 -2
  5. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/example_config/output32x5A.yaml +35 -35
  6. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/__init__.py +20 -21
  7. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/config.py +2 -1
  8. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/ds2482/onewire.py +2 -2
  9. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/events.py +3 -2
  10. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/gpio.py +6 -11
  11. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/ha_discovery.py +3 -5
  12. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/loader.py +9 -8
  13. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/logger.py +1 -0
  14. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/stats.py +4 -5
  15. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/timeperiod.py +1 -2
  16. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/util.py +1 -1
  17. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/yaml_util.py +13 -6
  18. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/input/gpio.py +2 -6
  19. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/manager.py +58 -48
  20. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/modbus.py +9 -10
  21. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/mqtt_client.py +3 -3
  22. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/relay/basic.py +1 -1
  23. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/relay/mcp.py +5 -4
  24. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/runner.py +5 -4
  25. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/schema/actions.yaml +3 -0
  26. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/schema/schema.yaml +1 -1
  27. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/__init__.py +3 -3
  28. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/gpio.py +1 -1
  29. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/modbus/__init__.py +10 -11
  30. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/temp/__init__.py +4 -9
  31. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/temp/dallas.py +5 -8
  32. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/temp/lm75.py +3 -1
  33. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/temp/mcp9808.py +3 -1
  34. boneIO-0.4.0.dev1/boneio/version.py +2 -0
  35. boneIO-0.4.0.dev1/pyproject.toml +75 -0
  36. boneIO-0.4.0.dev1/tests/32_5_config.yaml +11 -0
  37. boneIO-0.4.0.dev1/tests/bandit.yaml +21 -0
  38. boneIO-0.4.0.dev1/tests/relay_32_5.py +38 -0
  39. boneio-0.3.0.dev9/MANIFEST.in +0 -6
  40. boneio-0.3.0.dev9/PKG-INFO +0 -39
  41. boneio-0.3.0.dev9/boneio/version.py +0 -2
  42. boneio-0.3.0.dev9/boneio.egg-info/PKG-INFO +0 -39
  43. boneio-0.3.0.dev9/boneio.egg-info/SOURCES.txt +0 -69
  44. boneio-0.3.0.dev9/boneio.egg-info/dependency_links.txt +0 -1
  45. boneio-0.3.0.dev9/boneio.egg-info/entry_points.txt +0 -2
  46. boneio-0.3.0.dev9/boneio.egg-info/requires.txt +0 -23
  47. boneio-0.3.0.dev9/boneio.egg-info/top_level.txt +0 -1
  48. boneio-0.3.0.dev9/requirements.txt +0 -41
  49. boneio-0.3.0.dev9/setup.cfg +0 -4
  50. boneio-0.3.0.dev9/setup.py +0 -57
  51. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/LICENSE +0 -0
  52. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/README.md +0 -0
  53. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/__init__.py +0 -0
  54. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/bonecli.py +1 -1
  55. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/example_config/__init__.py +0 -0
  56. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/example_config/adc.yaml +0 -0
  57. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/example_config/config.yaml +0 -0
  58. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/example_config/cover.yaml +0 -0
  59. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/example_config/input.yaml +0 -0
  60. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/fonts/danube__.ttf +0 -0
  61. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/ds2482/__init__.py +0 -0
  62. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/ds2482/ds2482.py +0 -0
  63. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/exceptions.py +0 -0
  64. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/mqtt.py +0 -0
  65. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/oled.py +0 -0
  66. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/queue.py +0 -0
  67. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/helper/state_manager.py +1 -1
  68. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/input/__init__.py +0 -0
  69. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/oled.py +3 -3
  70. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/relay/__init__.py +0 -0
  71. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/relay/gpio.py +1 -1
  72. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/schema/actions_sensor.yaml +0 -0
  73. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/schema/actions_switch.yaml +0 -0
  74. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/adc.py +1 -1
  75. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/modbus/sdm120.json +0 -0
  76. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/modbus/sdm630.json +0 -0
  77. {boneio-0.3.0.dev9 → boneIO-0.4.0.dev1}/boneio/sensor/modbus/sofar.json +0 -0
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.1
2
+ Name: boneIO
3
+ Version: 0.4.0dev1
4
+ Summary: Python App for BoneIO
5
+ License: GNU General Public License v3.0
6
+ Author-email: Paweł Szafer <pszafer@gmail.com>
7
+ Requires-Python: >=3.7
8
+ Project-URL: Changelog, https://github.com/boneIO-eu/app_bbb/releases
9
+ Project-URL: Documentation, https://boneio.eu/docs/intro/
10
+ Project-URL: Homepage, https://boneio.eu
11
+ Project-URL: Repository, https://github.com/boneIO-eu/app_bbb
12
+ Description-Content-Type: text/markdown
13
+ Description: Example usage:
14
+ boneio run -dd -c config.yaml
15
+
16
+ # Installation instructions
17
+
18
+ ```
19
+ sudo apt-get install libopenjp2-7-dev libatlas-base-dev python3-venv
20
+ mkdir ~/boneio
21
+ python3 -m venv ~/boneio/venv
22
+ source ~/boneio/venv/bin/activate
23
+ pip3 install --upgrade boneio
24
+ cp ~/venv/lib/python3.7/site-packages/boneio/example_config/*.yaml ~/boneio/
25
+ ```
26
+
27
+ Edit config.yaml
28
+
29
+ # Start app
30
+
31
+ ```
32
+ source ~/boneio/venv/bin/activate
33
+ boneio run -c ~/boneio/config.yaml -dd
34
+ ```
35
+
@@ -1,8 +1,6 @@
1
1
  # from typing import Literal
2
- from datetime import timedelta
3
-
4
2
  try:
5
- from Adafruit_BBIO.GPIO import HIGH, LOW, BOTH, FALLING, RISING
3
+ from Adafruit_BBIO.GPIO import BOTH, FALLING, HIGH, LOW, RISING
6
4
  except ModuleNotFoundError:
7
5
  HIGH = "high"
8
6
  LOW = "low"
@@ -54,6 +52,7 @@ UARTS = {
54
52
  "uart5": {ID: "/dev/ttyS5", TX: "P8.37", RX: "P8.38"},
55
53
  }
56
54
 
55
+ relay_actions = {ON: "turn_on", OFF: "turn_off", "TOGGLE": "toggle"}
57
56
 
58
57
  # HA CONSTS
59
58
  HOMEASSISTANT = "homeassistant"
@@ -2,7 +2,8 @@
2
2
  import asyncio
3
3
  import logging
4
4
  from typing import Callable
5
- from boneio.const import CLOSE, COVER, IDLE, OPEN, OPENING, CLOSING, CLOSED, STOP
5
+
6
+ from boneio.const import CLOSE, CLOSED, CLOSING, COVER, IDLE, OPEN, OPENING, STOP
6
7
  from boneio.helper.events import EventBus
7
8
  from boneio.helper.mqtt import BasicMqtt
8
9
  from boneio.helper.timeperiod import TimePeriod
@@ -88,7 +88,7 @@
88
88
  mcp_id: mcp2
89
89
  pin: 0
90
90
  output_type: light
91
- - id: OUT_19
91
+ - id: OUT_19
92
92
  kind: mcp
93
93
  mcp_id: mcp2
94
94
  pin: 1
@@ -117,4 +117,4 @@
117
117
  kind: mcp
118
118
  mcp_id: mcp1
119
119
  pin: 10
120
- output_type: light
120
+ output_type: light
@@ -4,195 +4,195 @@
4
4
  mcp_id: mcp1
5
5
  pin: 0
6
6
  output_type: light
7
-
7
+
8
8
  - id: OUT_02
9
9
  kind: mcp
10
10
  mcp_id: mcp1
11
11
  pin: 1
12
12
  output_type: light
13
-
13
+
14
14
  - id: OUT_03
15
15
  kind: mcp
16
16
  mcp_id: mcp1
17
17
  pin: 2
18
18
  output_type: light
19
-
19
+
20
20
  - id: OUT_04
21
21
  kind: mcp
22
22
  mcp_id: mcp1
23
23
  pin: 3
24
24
  output_type: light
25
-
25
+
26
26
  - id: OUT_05
27
27
  kind: mcp
28
28
  mcp_id: mcp1
29
29
  pin: 4
30
30
  output_type: light
31
-
31
+
32
32
  - id: OUT_06
33
33
  kind: mcp
34
34
  mcp_id: mcp1
35
35
  pin: 5
36
36
  output_type: light
37
-
37
+
38
38
  - id: OUT_07
39
39
  kind: mcp
40
40
  mcp_id: mcp1
41
41
  pin: 6
42
42
  output_type: light
43
-
43
+
44
44
  - id: OUT_08
45
45
  kind: mcp
46
46
  mcp_id: mcp1
47
47
  pin: 7
48
48
  output_type: light
49
-
50
-
49
+
50
+
51
51
  # mcp2 - upper right 8 relays
52
52
  - id: OUT_09
53
53
  kind: mcp
54
54
  mcp_id: mcp2
55
55
  pin: 0
56
56
  output_type: light
57
-
57
+
58
58
  - id: OUT_10
59
59
  kind: mcp
60
60
  mcp_id: mcp2
61
61
  pin: 1
62
62
  output_type: light
63
-
63
+
64
64
  - id: OUT_11
65
65
  kind: mcp
66
66
  mcp_id: mcp2
67
67
  pin: 2
68
68
  output_type: light
69
-
69
+
70
70
  - id: OUT_12
71
71
  kind: mcp
72
72
  mcp_id: mcp2
73
73
  pin: 3
74
74
  output_type: light
75
-
75
+
76
76
  - id: OUT_13
77
77
  kind: mcp
78
78
  mcp_id: mcp2
79
79
  pin: 4
80
80
  output_type: light
81
-
81
+
82
82
  - id: OUT_14
83
83
  kind: mcp
84
84
  mcp_id: mcp2
85
85
  pin: 5
86
86
  output_type: light
87
-
87
+
88
88
  - id: OUT_15
89
89
  kind: mcp
90
90
  mcp_id: mcp2
91
91
  pin: 6
92
92
  output_type: light
93
-
93
+
94
94
  - id: OUT_16
95
95
  kind: mcp
96
96
  mcp_id: mcp2
97
97
  pin: 7
98
98
  output_type: light
99
-
100
-
99
+
100
+
101
101
  # mcp1 - lower left 8 relays
102
102
  - id: OUT_17
103
103
  kind: mcp
104
104
  mcp_id: mcp1
105
105
  pin: 8
106
106
  output_type: light
107
-
107
+
108
108
  - id: OUT_18
109
109
  kind: mcp
110
110
  mcp_id: mcp1
111
111
  pin: 9
112
112
  output_type: light
113
-
113
+
114
114
  - id: OUT_19
115
115
  kind: mcp
116
116
  mcp_id: mcp1
117
117
  pin: 10
118
118
  output_type: light
119
-
119
+
120
120
  - id: OUT_20
121
121
  kind: mcp
122
122
  mcp_id: mcp1
123
123
  pin: 11
124
124
  output_type: light
125
-
125
+
126
126
  - id: OUT_21
127
127
  kind: mcp
128
128
  mcp_id: mcp1
129
129
  pin: 12
130
130
  output_type: light
131
-
131
+
132
132
  - id: OUT_22
133
133
  kind: mcp
134
134
  mcp_id: mcp1
135
135
  pin: 13
136
136
  output_type: light
137
-
137
+
138
138
  - id: OUT_23
139
139
  kind: mcp
140
140
  mcp_id: mcp1
141
141
  pin: 14
142
142
  output_type: light
143
-
143
+
144
144
  - id: OUT_24
145
145
  kind: mcp
146
146
  mcp_id: mcp1
147
147
  pin: 15
148
148
  output_type: light
149
-
150
-
149
+
150
+
151
151
  # mcp2 - lower right 8 relays
152
152
  - id: OUT_25
153
153
  kind: mcp
154
154
  mcp_id: mcp2
155
155
  pin: 8
156
156
  output_type: light
157
-
157
+
158
158
  - id: OUT_26
159
159
  kind: mcp
160
160
  mcp_id: mcp2
161
161
  pin: 9
162
162
  output_type: light
163
-
163
+
164
164
  - id: OUT_27
165
165
  kind: mcp
166
166
  mcp_id: mcp2
167
167
  pin: 10
168
168
  output_type: light
169
-
169
+
170
170
  - id: OUT_28
171
171
  kind: mcp
172
172
  mcp_id: mcp2
173
173
  pin: 11
174
174
  output_type: light
175
-
175
+
176
176
  - id: OUT_29
177
177
  kind: mcp
178
178
  mcp_id: mcp2
179
179
  pin: 12
180
180
  output_type: light
181
-
181
+
182
182
  - id: OUT_30
183
183
  kind: mcp
184
184
  mcp_id: mcp2
185
185
  pin: 13
186
186
  output_type: light
187
-
187
+
188
188
  - id: OUT_31
189
189
  kind: mcp
190
190
  mcp_id: mcp2
191
191
  pin: 14
192
192
  output_type: light
193
-
193
+
194
194
  - id: OUT_32
195
195
  kind: mcp
196
196
  mcp_id: mcp2
197
197
  pin: 15
198
- output_type: light
198
+ output_type: light
@@ -1,39 +1,38 @@
1
1
  """Helper dir for BoneIO."""
2
2
 
3
+ from boneio.helper.exceptions import GPIOInputException, I2CError
3
4
  from boneio.helper.gpio import (
5
+ GpioBaseClass,
6
+ configure_pin,
4
7
  edge_detect,
8
+ read_input,
5
9
  setup_input,
6
10
  setup_output,
7
- read_input,
8
11
  write_output,
9
- GpioBaseClass,
10
- configure_pin,
11
12
  )
12
- from boneio.helper.oled import make_font
13
- from boneio.helper.mqtt import BasicMqtt
14
- from boneio.helper.stats import HostData, host_stats
15
- from boneio.helper.yaml_util import (
16
- CustomValidator,
17
- load_yaml_file,
18
- schema_file,
19
- load_config_from_string,
20
- load_config_from_file,
21
- )
22
- from boneio.helper.state_manager import StateManager
23
13
  from boneio.helper.ha_discovery import (
24
- ha_light_availabilty_message,
25
- ha_switch_availabilty_message,
26
- ha_sensor_temp_availabilty_message,
27
- ha_button_availabilty_message,
14
+ ha_adc_sensor_availabilty_message,
28
15
  ha_binary_sensor_availabilty_message,
16
+ ha_button_availabilty_message,
29
17
  ha_input_availabilty_message,
18
+ ha_light_availabilty_message,
30
19
  ha_sensor_availabilty_message,
31
- ha_adc_sensor_availabilty_message,
20
+ ha_sensor_temp_availabilty_message,
21
+ ha_switch_availabilty_message,
32
22
  )
33
- from boneio.helper.exceptions import GPIOInputException, I2CError
23
+ from boneio.helper.mqtt import BasicMqtt
24
+ from boneio.helper.oled import make_font
34
25
  from boneio.helper.queue import UniqueQueue
26
+ from boneio.helper.state_manager import StateManager
27
+ from boneio.helper.stats import HostData, host_stats
35
28
  from boneio.helper.timeperiod import TimePeriod
36
-
29
+ from boneio.helper.yaml_util import (
30
+ CustomValidator,
31
+ load_config_from_file,
32
+ load_config_from_string,
33
+ load_yaml_file,
34
+ schema_file,
35
+ )
37
36
 
38
37
  __all__ = [
39
38
  "CustomValidator",
@@ -1,9 +1,10 @@
1
1
  """
2
2
  Module to provide basic config options.
3
3
  """
4
- from boneio.const import BONEIO, HOMEASSISTANT
5
4
  from _collections_abc import dict_values
6
5
 
6
+ from boneio.const import BONEIO, HOMEASSISTANT
7
+
7
8
 
8
9
  class ConfigHelper:
9
10
  def __init__(
@@ -2,10 +2,10 @@
2
2
  Module by https://github.com/fgervais/ds2482
3
3
  """
4
4
  import adafruit_onewire.bus
5
- import busio
5
+ from onewireio import OneWire as OneWireIO
6
6
 
7
7
 
8
- class OneWire(busio.OneWire):
8
+ class OneWire(OneWireIO):
9
9
  def __init__(self, ds2482):
10
10
  self.ds2482 = ds2482
11
11
 
@@ -1,10 +1,11 @@
1
1
  import asyncio
2
2
  import datetime as dt
3
- import signal
4
3
  import logging
4
+ import signal
5
5
  import time
6
- from typing import Callable, Optional
7
6
  from datetime import datetime
7
+ from typing import Callable, Optional
8
+
8
9
  from boneio.helper.util import callback
9
10
 
10
11
  _LOGGER = logging.getLogger(__name__)
@@ -15,19 +15,14 @@ except ModuleNotFoundError:
15
15
 
16
16
  pass
17
17
 
18
- from boneio.helper.exceptions import GPIOInputException
19
- from boneio.const import LOW, FALLING, Gpio_Edges, Gpio_States
20
- from boneio.helper.timeperiod import TimePeriod
21
-
22
- from typing import Callable
23
18
  import subprocess
19
+ from typing import Callable
24
20
 
25
- from boneio.const import (
26
- CONFIG_PIN,
27
- GPIO as GPIO_STR,
28
- GPIO_MODE,
29
- ClickTypes,
30
- )
21
+ from boneio.const import CONFIG_PIN, FALLING
22
+ from boneio.const import GPIO as GPIO_STR
23
+ from boneio.const import GPIO_MODE, LOW, ClickTypes, Gpio_Edges, Gpio_States
24
+ from boneio.helper.exceptions import GPIOInputException
25
+ from boneio.helper.timeperiod import TimePeriod
31
26
 
32
27
  _LOGGER = logging.getLogger(__name__)
33
28
 
@@ -1,22 +1,20 @@
1
- from boneio.version import __version__
2
-
3
-
4
1
  from boneio.const import (
5
2
  CLOSE,
6
3
  CLOSED,
7
4
  CLOSING,
8
5
  COVER,
9
6
  INPUT,
7
+ INPUT_SENSOR,
10
8
  OFF,
11
9
  ON,
12
10
  OPEN,
13
11
  OPENING,
14
12
  RELAY,
15
- STATE,
16
13
  SENSOR,
17
- INPUT_SENSOR,
14
+ STATE,
18
15
  STOP,
19
16
  )
17
+ from boneio.version import __version__
20
18
 
21
19
 
22
20
  def ha_availabilty_message(
@@ -1,17 +1,20 @@
1
1
  from __future__ import annotations
2
2
 
3
- import logging
4
3
  import asyncio
4
+ import logging
5
5
  import time
6
- from typing import TYPE_CHECKING, Any, Callable
7
6
  from collections import namedtuple
7
+ from typing import TYPE_CHECKING, Any, Callable
8
8
 
9
9
  from adafruit_mcp230xx.mcp23017 import MCP23017
10
+ from adafruit_onewire.bus import OneWireAddress
11
+
10
12
  from boneio.const import (
11
13
  ACTIONS,
12
14
  ADDRESS,
13
15
  BINARY_SENSOR,
14
16
  COVER,
17
+ DEVICE_CLASS,
15
18
  GPIO,
16
19
  ID,
17
20
  INIT_SLEEP,
@@ -31,7 +34,6 @@ from boneio.const import (
31
34
  SENSOR,
32
35
  SHOW_HA,
33
36
  UPDATE_INTERVAL,
34
- DEVICE_CLASS,
35
37
  )
36
38
  from boneio.cover import Cover
37
39
  from boneio.helper import (
@@ -43,22 +45,21 @@ from boneio.helper import (
43
45
  ha_input_availabilty_message,
44
46
  ha_sensor_temp_availabilty_message,
45
47
  )
46
- from adafruit_onewire.bus import OneWireAddress
47
- from boneio.helper.ds2482 import DS2482, OneWireBus, ds_address, DS2482_ADDRESS
48
+ from boneio.helper.ds2482 import DS2482, DS2482_ADDRESS, OneWireBus, ds_address
48
49
  from boneio.helper.ha_discovery import ha_cover_availabilty_message
49
50
  from boneio.helper.timeperiod import TimePeriod
50
51
  from boneio.input.gpio import GpioInputButton
51
- from boneio.helper.config import ConfigHelper
52
52
  from boneio.sensor import DallasSensor
53
53
 
54
54
  # Typing imports that create a circular dependency
55
55
  if TYPE_CHECKING:
56
56
  from ..manager import Manager
57
- from boneio.modbus import Modbus
57
+
58
+ from busio import I2C
59
+
58
60
  from boneio.relay import GpioRelay, MCPRelay
59
61
  from boneio.sensor import GpioADCSensor, initialize_adc
60
62
  from boneio.sensor.gpio import GpioInputSensor
61
- from busio import I2C
62
63
 
63
64
  _LOGGER = logging.getLogger(__name__)
64
65
 
@@ -1,4 +1,5 @@
1
1
  import logging
2
+
2
3
  from boneio.const import PAHO, PYMODBUS
3
4
  from boneio.version import __version__
4
5
 
@@ -12,20 +12,19 @@ from boneio.const import (
12
12
  DISK,
13
13
  GIGABYTE,
14
14
  HOST,
15
+ IP,
16
+ MAC,
17
+ MASK,
15
18
  MEGABYTE,
16
19
  MEMORY,
17
20
  NETWORK,
21
+ NONE,
18
22
  SWAP,
19
23
  UPTIME,
20
- IP,
21
- MASK,
22
- MAC,
23
- NONE,
24
24
  )
25
25
  from boneio.sensor import LM75Sensor, MCP9808Sensor
26
26
  from boneio.version import __version__
27
27
 
28
-
29
28
  intervals = (("d", 86400), ("h", 3600), ("m", 60))
30
29
 
31
30
 
@@ -1,7 +1,6 @@
1
+ import math
1
2
  from collections import OrderedDict
2
-
3
3
  from datetime import timedelta
4
- import math
5
4
 
6
5
 
7
6
  def is_approximately_integer(value):
@@ -1,4 +1,4 @@
1
- from typing import Callable, TypeVar, Any
1
+ from typing import Any, Callable, TypeVar
2
2
 
3
3
  CALLABLE_T = TypeVar("CALLABLE_T", bound=Callable[..., Any])
4
4
  CALLBACK_TYPE = Callable[[], None]
@@ -1,16 +1,17 @@
1
- import re
2
1
  import fnmatch
3
- from collections import OrderedDict
4
2
  import logging
5
- from typing import Any, Tuple
6
3
  import os
7
- from cerberus import Validator, TypeDefinition
4
+ import re
5
+ from collections import OrderedDict
6
+ from typing import Any, Tuple
7
+
8
+ from cerberus import TypeDefinition, Validator
9
+ from yaml import MarkedYAMLError, SafeLoader, YAMLError, load
10
+
8
11
  from boneio.const import COVER, ID, OUTPUT
9
- from yaml import load, YAMLError, SafeLoader, MarkedYAMLError
10
12
  from boneio.helper.exceptions import ConfigurationException
11
13
  from boneio.helper.timeperiod import TimePeriod
12
14
 
13
-
14
15
  schema_file = os.path.join(os.path.dirname(__file__), "../schema/schema.yaml")
15
16
  _LOGGER = logging.getLogger(__name__)
16
17
 
@@ -226,6 +227,12 @@ class CustomValidator(Validator):
226
227
  def _normalize_coerce_lower(self, value):
227
228
  return str(value).lower()
228
229
 
230
+ def _normalize_coerce_upper(self, value):
231
+ return str(value).upper()
232
+
233
+ def _normalize_coerce_actions_output(self, value):
234
+ return str(value).lower()
235
+
229
236
  def _normalize_coerce_str(self, value):
230
237
  return str(value)
231
238
 
@@ -3,12 +3,8 @@ import logging
3
3
  from datetime import datetime, timedelta
4
4
  from functools import partial
5
5
 
6
- from boneio.const import (
7
- DOUBLE,
8
- LONG,
9
- SINGLE,
10
- )
11
- from boneio.helper import edge_detect, GpioBaseClass
6
+ from boneio.const import DOUBLE, LONG, SINGLE
7
+ from boneio.helper import GpioBaseClass, edge_detect
12
8
 
13
9
  # TIMINGS FOR BUTTONS
14
10
  DEBOUNCE_DURATION = timedelta(microseconds=150000)