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

try to prevent wrong devices in discovery #88

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions homeduino.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,30 @@ module.exports = (env) ->

switch protocol.type
when 'switch'
config = {
class: 'HomeduinoRFSwitch'
protocols: protocolConfig
}
if event.values.state is true
config = {
class: 'HomeduinoRFSwitch'
protocols: protocolConfig
}
when 'dimmer'
config = {
class: 'HomeduinoRFDimmer'
protocols: protocolConfig
}
when 'weather'
config = {
class: 'HomeduinoRFWeatherStation'
protocols: protocolConfig
}
valid = true
if typeof event.values.temperature != 'undefined'
if event.values.temperature > 100 or event.values.temperature < -30
valid = false
if typeof event.values.humidity != 'undefined'
if event.values.humidity < 0 or event.values.humidity > 100
valid = false
if valid
console.log(event)
config = {
class: 'HomeduinoRFWeatherStation'
protocols: protocolConfig
}
when 'contact'
config = {
class: 'HomeduinoRFContactSensor'
Expand Down