This commit is contained in:
D. Scott Boggs 2024-06-19 19:25:17 -04:00
parent e087fe1157
commit 60cf0a0f1f
8 changed files with 93 additions and 0 deletions

4
.gitignore vendored
View file

@ -1 +1,5 @@
old/
env/
build/
dist/
**/*.egg-info/

14
default.nix Normal file
View file

@ -0,0 +1,14 @@
{
python3, ...
}: python3.pkgs.buildPythonApplication rec {
pname = "huecontrol";
version = "0.0.0";
format = "setuptools";
src = ./.;
propagatedBuildInputs = with python3.pkgs; [
bleak
rgbxy
];
}

27
flake.lock Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1711523803,
"narHash": "sha256-UKcYiHWHQynzj6CN/vTcix4yd1eCu1uFdsuarupdCQQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2726f127c15a4cc9810843b96cad73c7eb39e443",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

19
flake.nix Normal file
View file

@ -0,0 +1,19 @@
{
description = "Control Phillips Hue Bulbs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
sourceCode.url = "path:./src";
nixPackageFile.url = "path:./default.nix";
};
outputs = { self, nixpkgs }:
let system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
packages.${system} = {
bulbctl = pkgs.callPackage ./. {};
default = self.packages.${system}.bulbctl;
};
};
}

20
pyproject.toml Normal file
View file

@ -0,0 +1,20 @@
[build-system]
requires = ["setuptools>=65.0"]
build-backend = "setuptools.build_meta"
[project]
name = "bulbctl"
version = "0.0.1"
authors = [
{name="D. Scott Boggs", email="scott@tams.tech"}
]
description = "Control Phillips Hue light bulbs"
requires-python = ">=3.11" # this can probably be lowered, we'll see
classifiers = [
"Programming Language :: Python :: 3"
]
dependencies = [
"bleak",
"rgbxy"
]

1
src/bulbctl/__init__.py Normal file
View file

@ -0,0 +1 @@
from bleak import BleakClient

2
src/bulbctl/bulb.py Normal file
View file

@ -0,0 +1,2 @@
from bleak import BleakClient
from rgbxy import Converter, GamutC, get_light_gamut

6
src/bulbctl/config.py Normal file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env python3
# from libhueble
class Config:
lamps: Lamp