Git Product home page Git Product logo

glome's People

Contributors

dennisschroeder avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jluzny

glome's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/test.yml
  • actions/checkout v2.0.0
  • gleam-lang/setup-erlang v1.1.3
  • gleam-lang/setup-gleam v1.0.2

  • Check this box to trigger a request for Renovate to run again on this repository

Migration to Gleam 1.0

Hi @dennisschroeder

thanks a lot for this great HA library.
I just discovered Gleam lang and am excited by it so far. I'm also a hobby developer of HA-related automation (I contributed a bit to gome-assistant and I am also writing my port of it using Zig lang). I selected your lib as the way to get familiar with Gleam lang. :)

In my fork, you can see 1st attempt to migrate this lib into the latest versions of both gleam and relevant modules:

As I'm really very new to gleam/erlang/otp, some of the changes have not been tested yet - kind of a naive/best guess attempt so far.

When trying to execute the following test:

pub fn gla_test() {
  let config =
    Configuration(
      host: "SOME_IP",
      port: 8123,
      access_token: AccessToken( "SOME_TOKEN",
      ),
    )

  homeassistant.connect(config, handle_connection)
}

fn handle_connection(ha: HomeAssistant) -> HomeAssistant {
  io.debug("Connecting to Home Assistant...")
  ha
}

I get this error:

{undef,
    [{gun,ws_send,
         [{connection,#Ref<0.461272038.4283170832.260722>,<0.146.0>},
          {text,
              <<"{\"type\":\"auth\",\"access_token\":\"SOME_TOKEN">>}],
         []},
     {nerf@websocket,ws_send,2,
         [{file,
              "/home/jiri/dev/ha/gla/glome/build/dev/erlang/nerf/_gleam_artefacts/[email protected]"},
          {line,64}]},
     {glome@core@authentication,authenticate,2,
         [{file,
              "/home/jiri/dev/ha/gla/glome/build/dev/erlang/glome/_gleam_artefacts/glome@[email protected]"},
          {line,75}]},
     {glome@homeassistant,'-connect/2-fun-1-',3,
         [{file,
              "/home/jiri/dev/ha/gla/glome/build/dev/erlang/glome/_gleam_artefacts/[email protected]"},
          {line,216}]}]}

Any idea why gun cannot send the message to HA?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.