mirror of https://github.com/arendst/Tasmota.git
Merge pull request #14971 from s-hadinger/axp_power_off
Berry add `axp.power_off()` for AXP192 devices
This commit is contained in:
commit
4778c9c8e5
|
@ -622,6 +622,7 @@ extern const bcstring be_const_str_point_arr;
|
|||
extern const bcstring be_const_str_pop;
|
||||
extern const bcstring be_const_str_pop_path;
|
||||
extern const bcstring be_const_str_pow;
|
||||
extern const bcstring be_const_str_power_off;
|
||||
extern const bcstring be_const_str_preinit;
|
||||
extern const bcstring be_const_str_print;
|
||||
extern const bcstring be_const_str_public_key;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -6,6 +6,11 @@ class AXP192 : I2C_Driver
|
|||
super(self, I2C_Driver).init("AXP192", 0x34)
|
||||
end
|
||||
|
||||
# power off the entire device from AXP192 - this is different from deepsleep
|
||||
def power_off()
|
||||
self.write_bit(0x32, 7, 1)
|
||||
end
|
||||
|
||||
# Return True = Battery Exist
|
||||
def battery_present()
|
||||
if self.wire.read(self.addr, 0x01, 1) & 0x20 return true
|
||||
|
|
Loading…
Reference in New Issue