1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, isPy27
5
6# propagates:
7, requests
8, websocket-client
9
10# extras: async
11, aiohttp
12, websockets
13
14# extras: encrypted
15, cryptography
16, py3rijndael
17
18# tests
19, aioresponses
20, pytest-asyncio
21, pytestCheckHook
22}:
23
24buildPythonPackage rec {
25 pname = "samsungtvws";
26 version = "2.6.0";
27 format = "setuptools";
28 disabled = isPy27;
29
30 src = fetchFromGitHub {
31 owner = "xchwarze";
32 repo = "samsung-tv-ws-api";
33 rev = "v${version}";
34 hash = "sha256-mkjfimzu7paz+ZskartL052AfUBtL1xU0eOlrHgD1UE=";
35 };
36
37 propagatedBuildInputs = [
38 requests
39 websocket-client
40 ];
41
42 passthru.optional-dependencies = {
43 async = [
44 aiohttp
45 websockets
46 ];
47 encrypted = [
48 cryptography
49 py3rijndael
50 ];
51 };
52
53 nativeCheckInputs = [
54 aioresponses
55 pytest-asyncio
56 pytestCheckHook
57 ]
58 ++ passthru.optional-dependencies.async
59 ++ passthru.optional-dependencies.encrypted;
60
61 pythonImportsCheck = [ "samsungtvws" ];
62
63 meta = with lib; {
64 description = "Samsung Smart TV WS API wrapper";
65 homepage = "https://github.com/xchwarze/samsung-tv-ws-api";
66 changelog = "https://github.com/xchwarze/samsung-tv-ws-api/releases/tag/v${version}";
67 license = licenses.mit;
68 maintainers = with maintainers; [ hexa ];
69 };
70}