EranVazana / Arctis-OLED-Battery-Indicator

Detailed information about your headset battery on the OLED screen.
16 stars 5 forks source link

Clean up the code a bit #2

Open joewright opened 4 years ago

joewright commented 4 years ago

Linting

This adds an .eslintrc.js file that works with most editors like Visual Studio Code to enforce code style and whatnot.

Most other code adjustments are to enforce the eslint-backed code style along with my personal preferences that I think improve readability/maintainability.

.gitignore

It also includes a .gitignore file and remove node_modules and daemon output directories. One downside is that users will now need to run npm install when downloading the project.

package.json

express and promise dependencies aren't used in the project so I removed them.

README.md

Includes a README file with user installation instructions and system requirements.

Code change

The biggest code change made here is updating the interval at which the battery is checked. Rather th an posting a message every 1 second, it's now doing it every 10. I tried 60 and realized that the SteelSeries Engine has a notification lifecycle, and I can see the value in keeping the indicator visible at all times.

Whoa that's a lot of changes!

Sorry about that! I will in no way be offended if this is too much change to accept into the mainline master branch.

Thanks again for making this project. It's fun to see how NodeJS can be used to interact with the SteelSeries engine and my devices.