Skip to content
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

Plutotom/api #19

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Plutotom/api #19

wants to merge 4 commits into from

Conversation

plutotom
Copy link

@plutotom plutotom commented Feb 2, 2025

Here is an example pr that includes running an API as a child process.
It works running npm run start but I am not very familiar with the build process so the API server does not start in the built exe.
Would love it if someone could help fix the build to make the child process work.

The goal is to have a general API that shows device status.

The reason I did this was to have my mouse battery in my home assistant using ha-multiscrape

Then in my configuration.ymal in home assistant I can do

# razor mouse Barrery
multiscrape:
  - resource: "http://<yourIpAddressThatIsRunningRazorTaskbar>:3001/battery"
    name: razor_cobra
    scan_interval: 5
    sensor:
      - name: Razor Cobra Battery
        unique_id: razor_cobra_battery_level
        icon: mdi:mouse-bluetooth
        value_template: "{{ value_json.devices[0].batteryPercentage }}"
        unit_of_measurement: "%"
        
      - name: Razor Cobra Charging
        unique_id: razor_cobra_is_charging
        icon: mdi:battery-charging
        value_template: "{{ value_json.devices[0].isCharging }}"
        

@sanraith
Copy link
Owner

sanraith commented Feb 3, 2025

I am not very familiar with the build process

I am not familiar with it either, lol. I think I just took a default config and was done with it.
I might try tinkering with it during the week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants