-
-
Notifications
You must be signed in to change notification settings - Fork 13
Add Anker MagGo 3-in-1 Wireless Charger (A25x7) #31
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?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| C1000G2, | ||
| F2000, | ||
| F3800, | ||
| MagGo3in1, | ||
| PrimeCharger160w, | ||
| PrimeCharger250w, | ||
| PrimePowerBank20k, | ||
|
|
@@ -1121,6 +1122,29 @@ async def async_setup_entry( | |
| ) | ||
| ) | ||
|
|
||
| # MagGo 3-in-1 wireless charger: per-pad power + total | ||
| if type(device) in [MagGo3in1]: | ||
| sensors.append( | ||
| SolixSensorEntity( | ||
| device, "Pad 1 Power", "W", "pad_1_power", SensorDeviceClass.POWER | ||
| ) | ||
| ) | ||
| sensors.append( | ||
| SolixSensorEntity( | ||
| device, "Pad 2 Power", "W", "pad_2_power", SensorDeviceClass.POWER | ||
| ) | ||
| ) | ||
| sensors.append( | ||
| SolixSensorEntity( | ||
| device, "Pad 3 Power", "W", "pad_3_power", SensorDeviceClass.POWER | ||
| ) | ||
| ) | ||
| sensors.append( | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There already is a sensor for total power that can be re-used.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the bespoke Total Power sensor and added |
||
| SolixSensorEntity( | ||
| device, "Total Power", "W", "total_power", SensorDeviceClass.POWER | ||
| ) | ||
| ) | ||
|
|
||
| async_add_entities(sensors) | ||
|
|
||
|
|
||
|
|
||
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.
These need to be individual so that devices which might have just 1 wireless charging pad can make use of this code by just adding them to the list for that sensor.
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.
Done — split into three separate per-pad blocks, each gated on its own
if type(device) in [MagGo3in1]:list, so a future single-pad device can be added to just the relevant pad's sensor.