Skip to content

workers / wine_inventory / src / pince_shelf / utils / tapo_manager.py

Path: workers/wine_inventory/src/pince_shelf/utils/tapo_manager.py
Lane: workers
Executable: yes

Purpose

pince_shelf.utils.tapo_manager

Purpose - Local light control for the cellar using a Tapo P110 smart plug. - Fixed-IP oriented implementation: avoid UDP discovery when host is known.

Design - No argparse. - All runtime values come from pince_shelf.env via settings.py. - Exposes two callable sync functions: - switch_light_on() - switch_light_off() - Also exposes async variants.

Entry points

  • __main__ guard detected

Key symbols

Classes

  • (none detected)

Functions

  • _build_credentials(c)
  • _connect_plug(cfg_in) [async]
  • _get_cfg(cfg_in)
  • _set_light_state(target_on, cfg_in) [async]
  • get_light_stabilize_seconds(cfg_in)
  • main()
  • switch_light_off(cfg_in)
  • switch_light_off_async(cfg_in) [async]
  • switch_light_on(cfg_in)
  • switch_light_on_async(cfg_in) [async]

Configuration & environment

  • (no env vars detected by regex)

Dependencies (imports)

  • __future__
  • asyncio
  • kasa
  • kasa.exceptions
  • logging
  • pince_shelf.config.settings
  • pince_shelf.utils.paths
  • typing

Operational notes (fill in)

  • Headless/interactive:
  • Systemd unit (if any):
  • Schedules/triggers:
  • Debug artifacts:
  • Failure modes: