Skip to content

Commit

Permalink
Update commands.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
w35l3y authored Jun 19, 2024
1 parent 8187cd4 commit 0c528b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion personal-tuya-devices/src/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,14 @@ local defaults = {
attribute = "carbonMonoxideLevel",
rate_name = "rate",
rate = 100,
unit = "ppm",
reportingInterval = 1,
from_zigbee = function (self, value, device)
local pref = get_child_or_parent(device, self.group).preferences
return 100 * to_number(value) / get_value(pref[self.rate_name], self.rate)
return {
value = 100 * to_number(value) / get_value(pref[self.rate_name], self.rate),
unit = self.unit
}
end,
},
-- colorControl = {
Expand Down

0 comments on commit 0c528b0

Please sign in to comment.