-
Notifications
You must be signed in to change notification settings - Fork 531
Expand file tree
/
Copy pathinit.lua
More file actions
24 lines (20 loc) · 741 Bytes
/
init.lua
File metadata and controls
24 lines (20 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0
local capabilities = require "st.capabilities"
local zigbee_constants = require "st.zigbee.constants"
local function device_init(driver, device)
device:set_field(zigbee_constants.SIMPLE_METERING_MULTIPLIER_KEY, 1, {persist = true})
device:set_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY, 100, {persist = true})
end
local simple_metering_config_subdriver = {
NAME = "Simple Metering Config",
supported_capabilities = {
capabilities.energyMeter,
capabilities.powerMeter
},
lifecycle_handlers = {
init = device_init
},
can_handle = require("simple-metering-config.can_handle")
}
return simple_metering_config_subdriver