Skip to content

Plutotom/api#19

Open
plutotom wants to merge 4 commits intosanraith:mainfrom
plutotom:plutotom/api
Open

Plutotom/api#19
plutotom wants to merge 4 commits intosanraith:mainfrom
plutotom:plutotom/api

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