Allow changing night mode
This commit is contained in:
parent
5bf7b519b7
commit
f49141ccf2
2 changed files with 29 additions and 1 deletions
24
bot.py
24
bot.py
|
@ -293,6 +293,30 @@ class Bot:
|
||||||
chat_id=msg.chat_id,
|
chat_id=msg.chat_id,
|
||||||
text=f"Privacy mode is {state and 'enabled' or 'disabled'}",
|
text=f"Privacy mode is {state and 'enabled' or 'disabled'}",
|
||||||
)
|
)
|
||||||
|
case "/night_mode_auto":
|
||||||
|
self.tapo.setDayNightMode("auto")
|
||||||
|
await self.bot.send_message(
|
||||||
|
chat_id=msg.chat_id,
|
||||||
|
text=f"Night mode set to auto",
|
||||||
|
)
|
||||||
|
case "/night_mode_on":
|
||||||
|
self.tapo.setDayNightMode("on")
|
||||||
|
await self.bot.send_message(
|
||||||
|
chat_id=msg.chat_id,
|
||||||
|
text=f"Night mode enabled",
|
||||||
|
)
|
||||||
|
case "/night_mode_off":
|
||||||
|
self.tapo.setDayNightMode("off")
|
||||||
|
await self.bot.send_message(
|
||||||
|
chat_id=msg.chat_id,
|
||||||
|
text=f"Night mode disabled",
|
||||||
|
)
|
||||||
|
case "/night_mode_status":
|
||||||
|
state = self.tapo.getDayNightMode()
|
||||||
|
await self.bot.send_message(
|
||||||
|
chat_id=msg.chat_id,
|
||||||
|
text=f"Night mode is {state}",
|
||||||
|
)
|
||||||
|
|
||||||
async def take_photo(
|
async def take_photo(
|
||||||
self, adjust_perspective=True, timeout=10.0
|
self, adjust_perspective=True, timeout=10.0
|
||||||
|
|
|
@ -7,4 +7,8 @@ privacy_off - Turn off privacy mode
|
||||||
privacy_status - Check the status of privacy mode
|
privacy_status - Check the status of privacy mode
|
||||||
light_on - Turn on the light
|
light_on - Turn on the light
|
||||||
light_off - Turn off the light
|
light_off - Turn off the light
|
||||||
light_status - Check the status of the light
|
light_status - Check the status of the light
|
||||||
|
night_mode_on - Turn on night mode
|
||||||
|
night_mode_off - Turn off night mode
|
||||||
|
night_mode_auto - Turn on automatic night mode
|
||||||
|
night_mode_status - Check the status of night mode
|
Loading…
Reference in a new issue