From ee52c704c88d756f0e444a1624a2d33ecd213ff0 Mon Sep 17 00:00:00 2001 From: Keenan Johnson Date: Thu, 14 Mar 2024 13:40:55 -0700 Subject: [PATCH 1/2] Golioth deploy: Auto rollout main release --- .github/workflows/build.yaml | 2 ++ tools/upload-to-golioth.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f0de4d9..5795b94 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -38,6 +38,7 @@ jobs: # Beta V4 Blueprint GOLIOTH_BLUEPRINT: 65c3ebd0f4542d968bf23817 GOLIOTH_API_KEY: ${{ secrets.GOLIOTH_API_KEY }} + GOLIOTH_ROLLOUT: true shell: bash - name: Upload to Golioth (Release) @@ -49,6 +50,7 @@ jobs: # Production V4 Blueprint GOLIOTH_BLUEPRINT: 638a8a406a504ec89e7b18ee GOLIOTH_API_KEY: ${{ secrets.GOLIOTH_API_KEY }} + GOLIOTH_ROLLOUT: false shell: bash - name: Upload artifacts diff --git a/tools/upload-to-golioth.py b/tools/upload-to-golioth.py index d3b01e4..c2c0b4f 100644 --- a/tools/upload-to-golioth.py +++ b/tools/upload-to-golioth.py @@ -21,6 +21,8 @@ def load_version(): project = os.environ["GOLIOTH_PROJECT"] blueprint = os.environ["GOLIOTH_BLUEPRINT"] +rollout = os.environ.get("GOLIOTH_ROLLOUT", "false") + req = { "blueprintId": blueprint, @@ -50,6 +52,7 @@ def load_version(): "artifactIds": [ artifact["data"]["id"], ], + "rollout":rollout } ), headers={ From 7f99dd14a26a3259a63817e941a8b0ba87e17c81 Mon Sep 17 00:00:00 2001 From: Keenan Johnson Date: Thu, 14 Mar 2024 13:42:24 -0700 Subject: [PATCH 2/2] Fix battery i2c read --- modules/ribbit/sensors/battery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ribbit/sensors/battery.py b/modules/ribbit/sensors/battery.py index 98e3a7d..b45afe6 100644 --- a/modules/ribbit/sensors/battery.py +++ b/modules/ribbit/sensors/battery.py @@ -44,7 +44,7 @@ def __init__(self, registry, id, interval=60): # The read_once method is called every time the sensor is polled. async def read_once(self): # Read the two bytes of voltage from the sensor. - bytes = self._i2c.readfrom_mem(self.ADDRESS, self.REG_VCELL, 2) + bytes = self._i2c_bus.readfrom_mem(self.ADDRESS, self.REG_VCELL, 2) self.voltage = unpack(">H", bytes)[0] * 78.125 / 1_000_000 # The export method is called to get the data from the sensor.