-
Notifications
You must be signed in to change notification settings - Fork 499
CHAD-15777: temperatureMeasurement:temperature registering for native… #2267
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
base: main
Are you sure you want to change the base?
CHAD-15777: temperatureMeasurement:temperature registering for native… #2267
Conversation
… handlers for zwave and zigbee
|
Invitation URL: |
Test Results 68 files 446 suites 0s ⏱️ For more details on these errors, see this check. Results for commit b737c06. |
matter-sensor_coverage.xml
matter-switch_coverage.xml
zigbee-thermostat_coverage.xml
zwave-sensor_coverage.xml
zwave-thermostat_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against b737c06 |
@@ -78,6 +78,9 @@ local function sensor_multilevel_report_handler(self, device, cmd) | |||
local scale = 'C' | |||
if (cmd.args.scale == SensorMultilevel.scale.temperature.FAHRENHEIT) then scale = 'F' end | |||
device:emit_event(capabilities.temperatureMeasurement.temperature({value = cmd.args.sensor_value, unit = scale})) | |||
if type(device.register_native_capability_attr_handler) == "function" then | |||
device:register_native_capability_attr_handler("temperatureMeasurement","temperature") | |||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typically I have avoided doing this in a subdriver even if I tested with it. Was this intended to be done or was it a part of testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I threw this in there because I've seen it done a few times and this was the device that I used to develop the NH for Z-wave. This logic follows the default handler logic, but maybe a better route is to remove this method from the subdriver?
The |
@@ -233,6 +233,9 @@ local function temperature_attr_handler(driver, device, ib, response) | |||
local temp = measured_value / 100.0 | |||
local unit = "C" | |||
device:emit_event_for_endpoint(ib.endpoint_id, capabilities.temperatureMeasurement.temperature({value = temp, unit = unit})) | |||
if type(device.register_native_capability_attr_handler) == "function" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the same be done for matter-thermostat?
Checklist
Description of Change
Registering of native handlers for zigbee and z-wave devices for temperatureMeasurement capabilities using the default handlers.
Summary of Completed Tests