Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "vendor/micropython"]
path = vendor/micropython
url = https://github.com/damz/micropython.git
url = https://github.com/Ribbit-Network/micropython
branch = pr/mbedtls
ignore = dirty
[submodule "vendor/microdot"]
Expand Down
21 changes: 12 additions & 9 deletions modules/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,21 @@ class Registry:
),
)

if not in_simulator:
registry.i2c_bus = _i2c.LockableI2CBus(
0, scl=machine.Pin(4), sda=machine.Pin(3), freq=50000
)

# Turn on the I2C power:
machine.Pin(7, mode=machine.Pin.OUT, value=1, hold=True)

else:
registry.i2c_bus = None

registry.config = _config.ConfigRegistry(config_schema, in_simulator=in_simulator)

if not in_simulator:
registry.network = _network.NetworkManager(registry.config)
registry.network = _network.NetworkManager(registry.config, registry.i2c_bus)
registry.time_manager = _time.TimeManager(registry.network)

registry.golioth = _golioth.Golioth(
Expand Down Expand Up @@ -178,14 +189,6 @@ async def write(self, data):

registry.sensors_output = Output()

if not in_simulator:
registry.i2c_bus = _i2c.LockableI2CBus(
0, scl=machine.Pin(4), sda=machine.Pin(3), freq=50000
)

# Turn on the I2C power:
machine.Pin(7, mode=machine.Pin.OUT, value=1, hold=True)

_, sensors, _ = registry.config.get("sensors")

for sensor in sensors:
Expand Down
3 changes: 2 additions & 1 deletion modules/ribbit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def __init__(self, keys, stored=True, in_simulator=False):
self._keys = collections.OrderedDict()
for key in keys:
self._keys[key.name] = key
key.default = key.hydrate(key.default)
if key.default is not None:
key.default = key.hydrate(key.default)

self._stored = stored
if in_simulator:
Expand Down
197 changes: 0 additions & 197 deletions modules/ribbit/network.py

This file was deleted.

Loading