Add multiple features without breaking existed#45
Open
ttimasdf wants to merge 3 commits into
Open
Conversation
There's the case that my home Wi-Fi contains many devices of different purposes, e.g. guest phone, TV stream box, IoT sensors and such. Those Wi-Fi clients shouldn't be reported as a device tracker, because we don't care about their connection status. So a whitelist function is implemented.
Contributor
|
How is it listening for dnsmasq events? |
Author
echo "dhcp-script=/usr/lib/hass-tracker/push_event.sh" >> /etc/dnsmasq.conf |
quthla
reviewed
Dec 31, 2019
| [ -z "$hostname" ] && hostname="$(get_host_name $mac)" | ||
| if [ -n "$hass_whitelist_devices" ] && ! array_contains "$hostname" $hass_whitelist_devices; then | ||
| logger -t $0 -p warning "push_event ignored, $hostname not in whitelist." | ||
| elif [ -z "$hostname" ]; then |
Contributor
There was a problem hiding this comment.
This will ignore devices with no hostname?
quthla
reviewed
Dec 31, 2019
| # get hostname for mac | ||
| nslookup "$(get_ip $1)" | grep -o "name = .*$" | cut -d ' ' -f 3 | ||
| domain="$(uci get dhcp.@dnsmasq[0].domain)" | ||
| nslookup "$(get_ip $1)" | grep -o "name = .*$" | cut -d ' ' -f 3 | sed -e "s/\\.$domain//" |
Contributor
There was a problem hiding this comment.
Why would you strip the domain?
mueslo
reviewed
Feb 15, 2020
| resp=$(curl "$hass_host/api/services/device_tracker/see" -sfSX POST \ | ||
| config_get hass_curl_insecure global curl_insecure | ||
|
|
||
| [ -n "$hass_curl_insecure" ] && curl_param="-k" |
Owner
There was a problem hiding this comment.
if hass_curl_insecure=0 this would still add the parameter, contrary to expectation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The modification is a bit messy so I combine the features inside one PR.
I didn't test the build. Only scp'ed the script with modified one a.nd it works..
Hopefully this could fix #37, fix #43, fix #8.