Skip to content

Commit

Permalink
tapo-py: Properly export all handlers
Browse files Browse the repository at this point in the history
Addresses #218.
  • Loading branch information
mihai-dinculescu committed May 20, 2024
1 parent cc53dab commit c423a92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ file. This change log follows the conventions of

## [Python Unreleased][Unreleased]

### Fixed

- All handlers are now correctly exported and can be imported from the `tapo` module.

## [Rust v0.7.11][v0.7.11] - 2024-05-04

### Added
Expand All @@ -31,7 +35,7 @@ file. This change log follows the conventions of

### Added

- Added partial support for the H100 hub and it's child devices. Currently, only the `get_device_info` function is supported for the child devices through the hub's `get_child_device_list` method.
- Added partial support for the H100 hub and its child devices. Currently, only the `get_device_info` function is supported for the child devices through the hub's `get_child_device_list` method.

### Changed

Expand Down
12 changes: 11 additions & 1 deletion tapo-py/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ mod handlers;
use pyo3::prelude::*;

use api_client::PyApiClient;
use handlers::{PyColorLightSetDeviceInfoParams, PyEnergyDataInterval};
use handlers::{
PyColorLightHandler, PyColorLightSetDeviceInfoParams, PyEnergyDataInterval,
PyGenericDeviceHandler, PyHubHandler, PyLightHandler, PyPlugEnergyMonitoringHandler,
PyPlugHandler,
};
use tapo::requests::Color;
use tapo::responses::{
ColorLightState, CurrentPowerResult, DefaultBrightnessState, DefaultColorLightState,
Expand All @@ -21,6 +25,12 @@ use tapo::responses::{
#[pyo3(name = "tapo")]
fn tapo_py(py: Python, module: &Bound<'_, PyModule>) -> PyResult<()> {
module.add_class::<PyApiClient>()?;
module.add_class::<PyColorLightHandler>()?;
module.add_class::<PyGenericDeviceHandler>()?;
module.add_class::<PyHubHandler>()?;
module.add_class::<PyLightHandler>()?;
module.add_class::<PyPlugEnergyMonitoringHandler>()?;
module.add_class::<PyPlugHandler>()?;

let requests = PyModule::new_bound(py, "tapo.requests")?;
let responses = PyModule::new_bound(py, "tapo.responses")?;
Expand Down

0 comments on commit c423a92

Please sign in to comment.