Skip to content

Commit

Permalink
Merge pull request #8 from kasperl/check-for-artemis
Browse files Browse the repository at this point in the history
Use artemis.defines if available.
  • Loading branch information
Kasper Lund authored Mar 6, 2024
2 parents 931873a + f520d59 commit 51dce18
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/package.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ packages:
..:
path: ..
prefixes:
artemis: toit-artemis
certificate_roots: toit-cert-roots
mqtt: mqtt
mqtt:
url: github.com/toitware/mqtt
name: mqtt
version: 2.7.0
hash: ae42b7f4949ec65512e845e7bef7e90a33a914d9
toit-artemis:
url: github.com/toitware/toit-artemis
name: artemis
version: 0.8.3
hash: c65898c512ec79173b523add1c8d13ec203b6e7e
toit-cert-roots:
url: github.com/toitware/toit-cert-roots
name: certificate_roots
Expand Down
6 changes: 6 additions & 0 deletions package.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sdk: ^2.0.0-alpha.100
prefixes:
artemis: toit-artemis
certificate_roots: toit-cert-roots
mqtt: mqtt
packages:
Expand All @@ -8,6 +9,11 @@ packages:
name: mqtt
version: 2.7.0
hash: ae42b7f4949ec65512e845e7bef7e90a33a914d9
toit-artemis:
url: github.com/toitware/toit-artemis
name: artemis
version: 0.8.3
hash: c65898c512ec79173b523add1c8d13ec203b6e7e
toit-cert-roots:
url: github.com/toitware/toit-cert-roots
name: certificate_roots
Expand Down
3 changes: 3 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: qubitro
description: Qubitro connector for the ESP32.
dependencies:
artemis:
url: github.com/toitware/toit-artemis
version: ^0.8.3
certificate_roots:
url: github.com/toitware/toit-cert-roots
version: ^1.6.1
Expand Down
4 changes: 3 additions & 1 deletion src/service.toit
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import net
import encoding.json
import encoding.tison

import artemis
import certificate-roots
import mqtt
import mqtt.packets as mqtt
Expand All @@ -28,7 +29,8 @@ CONFIG-DEVICE-TOKEN ::= "qubitro.device.token"
main:
logger ::= log.Logger log.DEBUG-LEVEL log.DefaultTarget --name="qubitro"
logger.info "service starting"
defines := assets.decode.get "jag.defines"
defines-key := artemis.available ? "artemis.defines" : "jag.defines"
defines := assets.decode.get defines-key
--if-present=: tison.decode it
--if-absent=: {:}
service := QubitroServiceProvider logger defines
Expand Down

0 comments on commit 51dce18

Please sign in to comment.