Skip to content

Commit

Permalink
now the thing stores the value by it self
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfa committed Mar 29, 2015
1 parent d82814d commit a4dbbf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/horst/src/things/hc_sr501_driver.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ init(Config) ->
{ok, Config}.

handle_msg({gpio_interrupt, 0, Pin, Status}, Config, Modul_config) ->
send(Config, Status),
send(Config, Status),
thing:set_value(self(), Status),
Module_config_1 = lists:keyreplace(last_changed, 1, Modul_config, {last_changed, date:get_date_seconds()}),
lists:keyreplace(driver, 1, Config, {driver, {?MODULE, handle_msg}, Module_config_1});

Expand Down
1 change: 1 addition & 0 deletions apps/horst/src/things/photocell_driver.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ call_sensor(Config, Module_config) ->
gpio:set_direction(Pin, out),
gpio:set_direction(Pin, in),
Value = loop(gpio:get(Pin), Pin, 0),
thing:set_value(self(), Value),
?SEND(Value),
Config.
%% --------------------------------------------------------------------
Expand Down

0 comments on commit a4dbbf8

Please sign in to comment.