bitlair_mqtt: Add hook to publish the amount of cash
This commit is contained in:
parent
be4abcb9dc
commit
5cbb052a0e
1 changed files with 8 additions and 0 deletions
|
@ -17,3 +17,11 @@ sub hook_checkout {
|
||||||
for 1..$entry->quantity;
|
for 1..$entry->quantity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub hook_user_balance {
|
||||||
|
my ($class, $user, $old, $delta, $new, $transaction_id) = @_;
|
||||||
|
|
||||||
|
return if $user != "-cash";
|
||||||
|
|
||||||
|
$mqtt->publish("bitlair/bank/cash" => "$new");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue