-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get example to execute #10
Comments
This is my example, is this incomplete? am i supposed to call function if i dont call
|
did you ever get this to work? I'm having the same issue. |
No, i think this is not a functioning api. Im using twocolors esphome-native-api and its working great. |
When I put "import hass from 'homeassistant-ws';" into my NodeJS app i get
"SyntaxError: Cannot use import statement outside a module"
normally I experience something like with the home-assistant library, It looks like this:
But your library have to use Import? why its like that? is there a way to just use require like in my example?
Anyway, i dont normally use "package.json" file for my project but I made this file and put this inside:
Ok so now seems to be going a step further, but now getting errors like :
if i remove this line (
import hass from 'hass';
) and keep only the line (import hass from 'homeassistant-ws';
) , then i get:I used many libraries already including the NPM home-assistant library with no issues but I have no idea how to make this work. I love this minimalist approach and using websocket for HA.
Can you please provide a working example? And can you please share how to import the library using the "Const Require" way? So i dont have to use package.json file? I'd really appreciate it and I love to share the project I'm going to use this library for.
The text was updated successfully, but these errors were encountered: