Aeotec Home Energy Meter Gen8#1981
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Channel deleted. |
Test Results 67 files + 1 443 suites +23 0s ⏱️ ±0s Results for commit b93df6a. ± Comparison against base commit 0db6c68. This pull request removes 4 and adds 125 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against b93df6a |
|
Hey @Brianj94 - Tagging you for your awareness :) |
| productId: 0x0001 | ||
| deviceProfileName: base-electric-meter | ||
| - id: "0x0371/0x0003/0x0033" #HEM Gen8 1 Phase EU | ||
| deviceLabel: Aeotec Home Engery Meter Gen8 Consumption |
There was a problem hiding this comment.
I believe "Engery" is a typo in all of these join names
| - id: "0x0371/0x0003/0x0034" # HEM Gen8 3 Phase EU | ||
| deviceLabel: Aeotec Home Engery Meter Gen8 Consumption | ||
| manufacturerId: 0x0371 | ||
| productType: 0x0003 |
There was a problem hiding this comment.
in general what we've done with other Aeotec devices is consolidated fingerprints by omitting the productType, which you could do here for the 1 and 3 phase meters
| version: 1 | ||
| categories: | ||
| - name: CurbPowerMeter | ||
| preferences: No newline at end of file |
There was a problem hiding this comment.
if there are no preferences, this line can be omitted. same above
There was a problem hiding this comment.
nit: you change back and forth between 2- and 4-space tab widths
| local child_device_key = find_hem8_child_device_key_by_endpoint(endpoint); | ||
| local child_device = device:get_child_by_parent_assigned_key(child_device_key) | ||
|
|
||
| if child_device then |
There was a problem hiding this comment.
Rather than repeating yourself here, you could just create a variable like device_to_emit_with that defaults to device and just overwrite it if a child_device is found. Avoids this if statement with the duplicated code.
There was a problem hiding this comment.
You are absolutely right.
There was a problem hiding this comment.
you should add the common functionality between the sub-drivers to this parent driver here, like the refresh function and the meter_report_handler
There was a problem hiding this comment.
I have intentionally moved the refresh and meter_report_handler functions to the sub-drivers because they each target different endpoints, which are defined in the sub-drivers. How could I implement this efficiently in the parent driver?
There was a problem hiding this comment.
I wasn't noticing the differences in the HEM8_DEVICES map. There's still probably a way to do it, but in light of those differences I imagine it's more complicated.
greens
left a comment
There was a problem hiding this comment.
Please add the copyright notice to the top of your source files.
|
Hello @mh-zwave Thank you for your PR. Please review the above comments and address them so that the review can proceed at your nearest opportunity. Thank you. |
- add copyright to source files - add missing tests - fix typos - consolidated fingerprints - fix line indentations - rework meter_report_handler function
|
| @@ -0,0 +1,190 @@ | |||
| -- Copyright 2022 SmartThings | |||
|
We'd prefer the original set of preferences included when this was first submitted. Some of the new preferences added, especially the bitmasks, don't make a ton of sense when presented in our preferences UI. |
|
I’ve removed some of the parameters. For those we still consider important, I’ve restricted the minimum and maximum values more tightly than what the device technically supports. I believe this is a good compromise and can be represented more effectively in your preference UI. |
| options: | ||
| 0: "Disable" | ||
| 1: "Enable" | ||
| default: 0 |
There was a problem hiding this comment.
This preference will most likely lead to problems, since we don't support reporting preference values from the device back up to the UI (two-way preferences).
If the user resets the preference values to the default (i.e. sets this value to "Enable"), the UI will still display the old values, and not the defaults that are actually set on the device.
| max: 7200 | ||
| default: 7200 | ||
| - name: lockConfig | ||
| title: "252. Enable/disable lock config" |
There was a problem hiding this comment.
this has the same problem as the reset preference
there's no way to communicate that setting a preference value has failed, which can lead to a bad experience
There was a problem hiding this comment.
Does what I said here make sense?
There was a problem hiding this comment.
So should I also remove the initially added preferences? However, these are really important because they allow the user to define the threshold values for reporting.
There was a problem hiding this comment.
Just the lock preference, I think. If the user locks the preferences, our UI can't reflect that.
There was a problem hiding this comment.
Ah ok, got it. I removed the lock preference.
|
Alright, I'll remove the newly added preferences again. Is it an issue that we set the reporting interval for power consumption to 5 minutes to ensure the powerConsumption report always provides a current value? Or could this cause problems for the hub? |
|
@mh-zwave 5 minutes is okay. |
Revert "Aeotec Home Energy Meter Gen8 (#1981)"
Revert "Aeotec Home Energy Meter Gen8 (#1981)"
* Aeotec Home Energy Meter Gen8 init * Add missing Configuration import * add missing device import * fix review comments - add copyright to source files - add missing tests - fix typos - consolidated fingerprints - fix line indentations - rework meter_report_handler function * remove unused imports * update copyright year * remove powerConsumptionReport capability from production child device profile * add missing Parameters * change deivce for power consumption report in meter report handler * add doConfigure lifecycle - add test for doConfigure lifecycle * fix line indentation * Update preferences * Remove preferences * Remove lock preference --------- Co-authored-by: Alissa Dornbos <79465613+lelandblue@users.noreply.github.com>
This reverts commit 1b1e49e.
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests