Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jimkring committed Jun 29, 2022
1 parent e110fd2 commit 2be7f05
Show file tree
Hide file tree
Showing 8 changed files with 423 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,7 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

*.build
*.dist
*.onefile-build
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# kasa-cli

A command-line application for the TP-Link Kasa Smarthome products (built with nuitka, wraps the python-kasa module).

## About

This project is simply a wrapper around the python-kasa python library (and it's cli.py submodule) that is built with nuitka into an executable (single file *.exe on Windows).
Empty file added kasa_cli/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions kasa_cli/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__version__ = '0.1.0'
import asyncio
from kasa import cli

if __name__ == "__main__":

# fixes a "raise RuntimeError('Event loop is closed')" error
# https://stackoverflow.com/questions/45600579/asyncio-event-loop-is-closed-when-getting-loop
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

cli.cli()
361 changes: 361 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[tool.poetry]
name = "kasa-cli"
version = "0.1.0"
description = ""
authors = ["Jim Kring <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.10"
python-kasa = "^0.5.0"

[tool.poetry.dev-dependencies]
pytest = "^5.2"
Nuitka = "^0.9.1"
ordered-set = "^4.1.0"

[build-system]
requires = ["setuptools>=42", "wheel", "nuitka", "toml"]
build-backend = "nuitka.distutils.Build"

[nuitka]
# These are not recommended, but they make it obvious to have effect.

# boolean option, e.g. if you cared for C compilation commands, leading
# dashes are omitted
# show-scons = true

# options with single values, e.g. enable a plugin of Nuitka
# enable-plugin = pyside2

# options with several values, e.g. avoiding including modules, accepts
# list argument.
# nofollow-import-to = ["*.tests", "*.distutils"]

onefile = true
standalone = true
Empty file added tests/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions tests/test_kasa_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from kasa_cli import __version__


def test_version():
assert __version__ == '0.1.0'

0 comments on commit 2be7f05

Please sign in to comment.