mueslo / openwrt_hass_devicetracker

Simple OpenWRT package which forwards device connection changes to a HomeAssistant instance
GNU General Public License v3.0
92 stars 31 forks source link

Added support for long term tokens #5

Closed miawgogo closed 6 years ago

miawgogo commented 6 years ago

I havent been able to test this as i can not get the tool chain setup on Ubuntu on windows but it should work

mueslo commented 6 years ago

Thank you for your work. However, please don't add an unnecessary 'auth type' configuration variable forcing reuse of the password field. Just add a token config field and use whichever is available. Additionally, please test and fix your errors.

I'll try to add a CI build configuration soon, getting the OpenWRT toolchain running is a bit of a hassle.

ohadlevy commented 6 years ago

@mueslo do you really need the entire tool chain? I wonder if we can't just mock up some functions and see if the script returns the expected value? maybe something like https://github.com/sstephenson/bats can be used?

miawgogo commented 6 years ago

Ive managed to test it by tesing the logic i made in isolation using normal bash, but it should work in ash

mueslo commented 6 years ago

@mueslo do you really need the entire tool chain? I wonder if we can't just mock up some functions and see if the script returns the expected value? maybe something like https://github.com/sstephenson/bats can be used?

The OpenWRT SDK/tool chain isn't for testing but rather for building an OpenWRT .ipk package that can be installed, since I'm not seeing any progress on getting this package added to OpenWRT by default. It's definitely overkill since there's no actual compilation necessary, but I don't see an easier alternative.

ProjectPatatoe commented 6 years ago

I couldn't get this to work because i kept getting "out of range" error on the token changing it to if [ $hass_token != 0 ]; then fixed it

miawgogo commented 6 years ago

@ProjectPatatoe yeah, I'm used to bash and googling busybox sh ash causes google to return stuff for ash

miawgogo commented 6 years ago

OK, put in @ProjecPatatoe 's fix for that issue

mueslo commented 6 years ago

If you have docker-compose installed you can now build a package by running docker-compose run pkgbuild

mueslo commented 6 years ago

let me know when you've tested this

pschmitt commented 6 years ago

I am currently testing this. Seems to be working okay. Nice!

robbz23 commented 5 years ago

Can you do a release for this so I dont have to build it myself?