blue-assistant 4.182.1__tar.gz → 4.221.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. {blue_assistant-4.182.1/blue_assistant.egg-info → blue_assistant-4.221.1}/PKG-INFO +31 -3
  2. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/README.md +30 -2
  3. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/alias.sh +1 -2
  4. blue_assistant-4.221.1/blue_assistant/.abcli/hue/create_user.sh +11 -0
  5. blue_assistant-4.221.1/blue_assistant/.abcli/hue/list.sh +11 -0
  6. blue_assistant-4.221.1/blue_assistant/.abcli/hue/set.sh +11 -0
  7. blue_assistant-4.221.1/blue_assistant/.abcli/hue.sh +15 -0
  8. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/tests/help.sh +6 -0
  9. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/README.py +2 -2
  10. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/__init__.py +1 -1
  11. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/config.env +3 -1
  12. blue_assistant-4.221.1/blue_assistant/env.py +19 -0
  13. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/help/functions.py +2 -0
  14. blue_assistant-4.221.1/blue_assistant/help/hue.py +113 -0
  15. blue_assistant-4.221.1/blue_assistant/sample.env +1 -0
  16. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/actions/generate_text.py +1 -1
  17. blue_assistant-4.221.1/blue_assistant/script/repository/hue/__main__.py +101 -0
  18. blue_assistant-4.221.1/blue_assistant/script/repository/hue/functions.py +171 -0
  19. {blue_assistant-4.182.1 → blue_assistant-4.221.1/blue_assistant.egg-info}/PKG-INFO +31 -3
  20. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant.egg-info/SOURCES.txt +7 -0
  21. blue_assistant-4.182.1/blue_assistant/env.py +0 -33
  22. blue_assistant-4.182.1/blue_assistant/sample.env +0 -0
  23. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/LICENSE +0 -0
  24. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/MANIFEST.in +0 -0
  25. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/abcli.sh +0 -0
  26. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/actions.sh +0 -0
  27. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/blue_assistant.sh +0 -0
  28. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/browse.sh +0 -0
  29. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/script/list.sh +0 -0
  30. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/script/run.sh +0 -0
  31. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/script.sh +0 -0
  32. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/tests/README.sh +0 -0
  33. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/tests/script_list.sh +0 -0
  34. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/tests/script_run.sh +0 -0
  35. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/tests/version.sh +0 -0
  36. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/tests/web_crawl.sh +0 -0
  37. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/web/crawl.sh +0 -0
  38. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/.abcli/web.sh +0 -0
  39. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/__main__.py +0 -0
  40. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/functions.py +0 -0
  41. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/help/__init__.py +0 -0
  42. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/help/__main__.py +0 -0
  43. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/help/script.py +0 -0
  44. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/help/web.py +0 -0
  45. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/host.py +0 -0
  46. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/logger.py +0 -0
  47. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/__init__.py +0 -0
  48. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/__main__.py +0 -0
  49. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/actions/__init__.py +0 -0
  50. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/actions/generate_image.py +0 -0
  51. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/actions/generic.py +0 -0
  52. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/load.py +0 -0
  53. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/__init__.py +0 -0
  54. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/base/__init__.py +0 -0
  55. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/base/classes.py +0 -0
  56. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/blue_amo/__init__.py +0 -0
  57. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/blue_amo/actions/__init__.py +0 -0
  58. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/blue_amo/actions/slicing_into_frames.py +0 -0
  59. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/blue_amo/actions/stitching_the_frames.py +0 -0
  60. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/blue_amo/classes.py +0 -0
  61. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/generic/__init__.py +0 -0
  62. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/generic/classes.py +0 -0
  63. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/hue/__init__.py +0 -0
  64. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/hue/classes.py +0 -0
  65. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/orbital_data_explorer/__init__.py +0 -0
  66. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/orbital_data_explorer/actions/__init__.py +0 -0
  67. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/orbital_data_explorer/actions/researching_the_questions.py +0 -0
  68. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/script/repository/orbital_data_explorer/classes.py +0 -0
  69. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/urls.py +0 -0
  70. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/web/__init__.py +0 -0
  71. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/web/__main__.py +0 -0
  72. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant/web/crawl.py +0 -0
  73. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant.egg-info/dependency_links.txt +0 -0
  74. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant.egg-info/requires.txt +0 -0
  75. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/blue_assistant.egg-info/top_level.txt +0 -0
  76. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/pyproject.toml +0 -0
  77. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/requirements.txt +0 -0
  78. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/setup.cfg +0 -0
  79. {blue_assistant-4.182.1 → blue_assistant-4.221.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_assistant
3
- Version: 4.182.1
3
+ Version: 4.221.1
4
4
  Summary: 🧠 An AI Assistant.
5
5
  Home-page: https://github.com/kamangir/blue-assistant
6
6
  Author: Arash Abadpour (Kamangir)
@@ -62,6 +62,7 @@ graph LR
62
62
  url["🔗 url"]:::folder
63
63
  object["📂 object"]:::folder
64
64
 
65
+
65
66
  script --> assistant_script_list
66
67
 
67
68
  script --> assistant_script_run
@@ -71,12 +72,39 @@ graph LR
71
72
  url --> assistant_web_crawl
72
73
  assistant_web_crawl --> object
73
74
 
75
+
76
+ bridge_ip["🔗 bridge_ip"]:::folder
77
+ hue_username["🔗 hue_username"]:::folder
78
+ list_of_lights["💡 light IDs"]:::folder
79
+
80
+ hue_create_user["@hue<br>create_user"]
81
+ hue_list["@hue<br>list"]
82
+ hue_set["@hue<br>set"]
83
+ hue_test["@hue<br>test"]
84
+
85
+ bridge_ip --> hue_create_user
86
+ hue_create_user --> hue_username
87
+
88
+ bridge_ip --> hue_list
89
+ hue_username --> hue_list
90
+ hue_list --> list_of_lights
91
+
92
+ bridge_ip --> hue_set
93
+ hue_username --> hue_set
94
+ list_of_lights --> hue_set
95
+
96
+ bridge_ip --> hue_test
97
+ hue_username --> hue_test
98
+ list_of_lights --> hue_test
99
+
100
+
101
+
74
102
  classDef folder fill:#999,stroke:#333,stroke-width:2px;
75
103
  ```
76
104
 
77
105
  | | |
78
106
  | --- | --- |
79
- | [`hue`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) [![image](https://github.com/kamangir/assets/blob/main/blue-assistant/hue.jpg?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) "send a color command to the Hue LED lights in my apartment." 🔥 | [`blue-amo`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) [![image](https://github.com/kamangir/assets/raw/main/blue-amo-2025-02-03-nswnx6/stitching_the_frames-2.png?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) A story developed and visualized, by AI. |
107
+ | [`hue`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) [![image](https://github.com/kamangir/assets/raw/main/blue-assistant/20250314_143702.jpg?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) "send a color command to the Hue LED lights in my apartment." | [`blue-amo`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) [![image](https://github.com/kamangir/assets/raw/main/blue-amo-2025-02-03-nswnx6/stitching_the_frames-2.png?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) A story developed and visualized, by AI. |
80
108
  | [`orbital-data-explorer`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/orbital_data_explorer/README.md) [![image](https://github.com/kamangir/assets/blob/main/blue-assistant/orbital-data-explorer.png?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/orbital_data_explorer/README.md) Access to the [Orbital Data Explorer](https://ode.rsl.wustl.edu/), through AI. ⏸️ | |
81
109
 
82
110
  ---
@@ -84,4 +112,4 @@ graph LR
84
112
 
85
113
  [![pylint](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-assistant.svg)](https://pypi.org/project/blue-assistant/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-assistant)](https://pypistats.org/packages/blue-assistant)
86
114
 
87
- built by 🌀 [`blue_options-4.234.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.182.1`](https://github.com/kamangir/blue-assistant).
115
+ built by 🌀 [`blue_options-4.234.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.221.1`](https://github.com/kamangir/blue-assistant).
@@ -17,6 +17,7 @@ graph LR
17
17
  url["🔗 url"]:::folder
18
18
  object["📂 object"]:::folder
19
19
 
20
+
20
21
  script --> assistant_script_list
21
22
 
22
23
  script --> assistant_script_run
@@ -26,12 +27,39 @@ graph LR
26
27
  url --> assistant_web_crawl
27
28
  assistant_web_crawl --> object
28
29
 
30
+
31
+ bridge_ip["🔗 bridge_ip"]:::folder
32
+ hue_username["🔗 hue_username"]:::folder
33
+ list_of_lights["💡 light IDs"]:::folder
34
+
35
+ hue_create_user["@hue<br>create_user"]
36
+ hue_list["@hue<br>list"]
37
+ hue_set["@hue<br>set"]
38
+ hue_test["@hue<br>test"]
39
+
40
+ bridge_ip --> hue_create_user
41
+ hue_create_user --> hue_username
42
+
43
+ bridge_ip --> hue_list
44
+ hue_username --> hue_list
45
+ hue_list --> list_of_lights
46
+
47
+ bridge_ip --> hue_set
48
+ hue_username --> hue_set
49
+ list_of_lights --> hue_set
50
+
51
+ bridge_ip --> hue_test
52
+ hue_username --> hue_test
53
+ list_of_lights --> hue_test
54
+
55
+
56
+
29
57
  classDef folder fill:#999,stroke:#333,stroke-width:2px;
30
58
  ```
31
59
 
32
60
  | | |
33
61
  | --- | --- |
34
- | [`hue`](./blue_assistant/script/repository/hue) [![image](https://github.com/kamangir/assets/blob/main/blue-assistant/hue.jpg?raw=true)](./blue_assistant/script/repository/hue) "send a color command to the Hue LED lights in my apartment." 🔥 | [`blue-amo`](./blue_assistant/script/repository/blue_amo/README.md) [![image](https://github.com/kamangir/assets/raw/main/blue-amo-2025-02-03-nswnx6/stitching_the_frames-2.png?raw=true)](./blue_assistant/script/repository/blue_amo/README.md) A story developed and visualized, by AI. |
62
+ | [`hue`](./blue_assistant/script/repository/hue) [![image](https://github.com/kamangir/assets/raw/main/blue-assistant/20250314_143702.jpg?raw=true)](./blue_assistant/script/repository/hue) "send a color command to the Hue LED lights in my apartment." | [`blue-amo`](./blue_assistant/script/repository/blue_amo/README.md) [![image](https://github.com/kamangir/assets/raw/main/blue-amo-2025-02-03-nswnx6/stitching_the_frames-2.png?raw=true)](./blue_assistant/script/repository/blue_amo/README.md) A story developed and visualized, by AI. |
35
63
  | [`orbital-data-explorer`](./blue_assistant/script/repository/orbital_data_explorer/README.md) [![image](https://github.com/kamangir/assets/blob/main/blue-assistant/orbital-data-explorer.png?raw=true)](./blue_assistant/script/repository/orbital_data_explorer/README.md) Access to the [Orbital Data Explorer](https://ode.rsl.wustl.edu/), through AI. ⏸️ | |
36
64
 
37
65
  ---
@@ -39,4 +67,4 @@ graph LR
39
67
 
40
68
  [![pylint](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-assistant.svg)](https://pypi.org/project/blue-assistant/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-assistant)](https://pypistats.org/packages/blue-assistant)
41
69
 
42
- built by 🌀 [`blue_options-4.234.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.182.1`](https://github.com/kamangir/blue-assistant).
70
+ built by 🌀 [`blue_options-4.234.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.221.1`](https://github.com/kamangir/blue-assistant).
@@ -2,5 +2,4 @@
2
2
 
3
3
  alias @assistant=blue_assistant
4
4
 
5
-
6
-
5
+ alias @hue=blue_assistant_hue
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_assistant_hue_create_user() {
4
+ local options=$1
5
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
6
+
7
+ abcli_eval dryrun=$do_dryrun \
8
+ python3 -m blue_assistant.script.repository.hue \
9
+ create_user \
10
+ "${@:2}"
11
+ }
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_assistant_hue_list() {
4
+ local options=$1
5
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
6
+
7
+ abcli_eval dryrun=$do_dryrun \
8
+ python3 -m blue_assistant.script.repository.hue \
9
+ list \
10
+ "${@:2}"
11
+ }
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_assistant_hue_set() {
4
+ local options=$1
5
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
6
+
7
+ abcli_eval dryrun=$do_dryrun \
8
+ python3 -m blue_assistant.script.repository.hue \
9
+ set \
10
+ "${@:2}"
11
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_assistant_hue() {
4
+ local task=$(abcli_unpack_keyword $1 help)
5
+
6
+ local function_name=blue_assistant_hue_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m blue_assistant.script.repository.hue "$@"
13
+ }
14
+
15
+ abcli_source_caller_suffix_path /hue
@@ -26,6 +26,12 @@ function test_blue_assistant_help() {
26
26
  "@assistant web" \
27
27
  "@assistant web crawl" \
28
28
  \
29
+ "@hue" \
30
+ "@hue create_user" \
31
+ "@hue list" \
32
+ "@hue set" \
33
+ "@hue test" \
34
+ \
29
35
  "blue_assistant"; do
30
36
  abcli_eval ,$options \
31
37
  abcli_help $module
@@ -10,8 +10,8 @@ items = README.Items(
10
10
  {
11
11
  "name": "hue",
12
12
  "url": "./blue_assistant/script/repository/hue",
13
- "marquee": "https://github.com/kamangir/assets/blob/main/blue-assistant/hue.jpg?raw=true",
14
- "description": '"send a color command to the Hue LED lights in my apartment." 🔥',
13
+ "marquee": "https://github.com/kamangir/assets/raw/main/blue-assistant/20250314_143702.jpg?raw=true",
14
+ "description": '"send a color command to the Hue LED lights in my apartment."',
15
15
  },
16
16
  {
17
17
  "name": "blue-amo",
@@ -4,7 +4,7 @@ ICON = "🧠"
4
4
 
5
5
  DESCRIPTION = f"{ICON} An AI Assistant."
6
6
 
7
- VERSION = "4.182.1"
7
+ VERSION = "4.221.1"
8
8
 
9
9
  REPO_NAME = "blue-assistant"
10
10
 
@@ -3,4 +3,6 @@ BLUE_ASSISTANT_TEXT_MAX_TOKENS=2000
3
3
 
4
4
  BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL=dall-e-3
5
5
  BLUE_ASSISTANT_IMAGE_DEFAULT_QUALITY=standard
6
- BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE=1024x1024
6
+ BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE=1024x1024
7
+
8
+ HUE_BRIDGE_IP_ADDRESS=192.168.1.95
@@ -0,0 +1,19 @@
1
+ from blue_options.env import load_config, load_env, get_env
2
+
3
+ load_env(__name__)
4
+ load_config(__name__)
5
+
6
+
7
+ BLUE_ASSISTANT_TEXT_DEFAULT_MODEL = get_env("BLUE_ASSISTANT_TEXT_DEFAULT_MODEL")
8
+
9
+ BLUE_ASSISTANT_TEXT_MAX_TOKENS = get_env("BLUE_ASSISTANT_TEXT_MAX_TOKENS", 2000)
10
+
11
+ BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL = get_env("BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL")
12
+
13
+ BLUE_ASSISTANT_IMAGE_DEFAULT_QUALITY = get_env("BLUE_ASSISTANT_IMAGE_DEFAULT_QUALITY")
14
+
15
+ BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE = get_env("BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE")
16
+
17
+ HUE_BRIDGE_IP_ADDRESS = get_env("HUE_BRIDGE_IP_ADDRESS")
18
+
19
+ HUE_BRIDGE_USERNAME = get_env("HUE_BRIDGE_USERNAME")
@@ -4,6 +4,7 @@ from blue_options.terminal import show_usage, xtra
4
4
  from abcli.help.generic import help_functions as generic_help_functions
5
5
 
6
6
  from blue_assistant import ALIAS
7
+ from blue_assistant.help.hue import help_functions as help_hue
7
8
  from blue_assistant.help.script import help_functions as help_script
8
9
  from blue_assistant.help.web import help_functions as help_web
9
10
 
@@ -30,6 +31,7 @@ help_functions = generic_help_functions(plugin_name=ALIAS)
30
31
  help_functions.update(
31
32
  {
32
33
  "browse": help_browse,
34
+ "hue": help_hue,
33
35
  "script": help_script,
34
36
  "web": help_web,
35
37
  }
@@ -0,0 +1,113 @@
1
+ from typing import List
2
+
3
+ from blue_options.terminal import show_usage, xtra
4
+
5
+ from blue_assistant import env
6
+
7
+
8
+ def help_create_user(
9
+ tokens: List[str],
10
+ mono: bool,
11
+ ) -> str:
12
+ options = xtra("dryrun", mono=mono)
13
+
14
+ args = [
15
+ f"[--bridge_ip <{env.HUE_BRIDGE_IP_ADDRESS}>]",
16
+ ]
17
+
18
+ return show_usage(
19
+ [
20
+ "@hue",
21
+ "create_user",
22
+ f"[{options}]",
23
+ ]
24
+ + args,
25
+ "create a hue user.",
26
+ mono=mono,
27
+ )
28
+
29
+
30
+ def help_list(
31
+ tokens: List[str],
32
+ mono: bool,
33
+ ) -> str:
34
+ options = xtra("dryrun", mono=mono)
35
+
36
+ args = [
37
+ f"[--bridge_ip <{env.HUE_BRIDGE_IP_ADDRESS}>]",
38
+ f"[--username <{env.HUE_BRIDGE_USERNAME}>]",
39
+ "[--verbose 1]",
40
+ ]
41
+
42
+ return show_usage(
43
+ [
44
+ "@hue",
45
+ "list",
46
+ f"[{options}]",
47
+ ]
48
+ + args,
49
+ "list hue lights.",
50
+ mono=mono,
51
+ )
52
+
53
+
54
+ def help_set(
55
+ tokens: List[str],
56
+ mono: bool,
57
+ ) -> str:
58
+ options = xtra("dryrun", mono=mono)
59
+
60
+ args = [
61
+ f"[--bridge_ip <{env.HUE_BRIDGE_IP_ADDRESS}>]",
62
+ f"[--username <{env.HUE_BRIDGE_USERNAME}>]",
63
+ "[--light_id <light_id>]",
64
+ "[--hue <65535>]",
65
+ "[--saturation <254>]",
66
+ "[--verbose 1]",
67
+ ]
68
+
69
+ return show_usage(
70
+ [
71
+ "@hue",
72
+ "set",
73
+ f"[{options}]",
74
+ ]
75
+ + args,
76
+ "set hue lights.",
77
+ mono=mono,
78
+ )
79
+
80
+
81
+ def help_test(
82
+ tokens: List[str],
83
+ mono: bool,
84
+ ) -> str:
85
+ options = xtra("dryrun", mono=mono)
86
+
87
+ args = [
88
+ f"[--bridge_ip <{env.HUE_BRIDGE_IP_ADDRESS}>]",
89
+ f"[--username <{env.HUE_BRIDGE_USERNAME}>]",
90
+ "[--light_id all | <light_id>]",
91
+ "[--interval <1>]",
92
+ "[--hue <65535>]",
93
+ "[--verbose 1]",
94
+ ]
95
+
96
+ return show_usage(
97
+ [
98
+ "@hue",
99
+ "test",
100
+ f"[{options}]",
101
+ ]
102
+ + args,
103
+ "test hue.",
104
+ mono=mono,
105
+ )
106
+
107
+
108
+ help_functions = {
109
+ "create_user": help_create_user,
110
+ "list": help_list,
111
+ "set": help_set,
112
+ "test": help_test,
113
+ }
@@ -0,0 +1 @@
1
+ HUE_BRIDGE_USERNAME=
@@ -44,7 +44,7 @@ def generate_text(
44
44
  "content": [
45
45
  {
46
46
  "type": "text",
47
- "text": script.nodes[context_node]["output"],
47
+ "text": script.nodes[context_node].get("output", ""),
48
48
  }
49
49
  ],
50
50
  }
@@ -0,0 +1,101 @@
1
+ import argparse
2
+
3
+ from blueness import module
4
+ from blueness.argparse.generic import sys_exit
5
+
6
+ from blue_assistant import NAME
7
+ from blue_assistant import env
8
+ from blue_assistant.script.repository.hue.functions import (
9
+ create_user,
10
+ list_lights,
11
+ set_light_color,
12
+ test,
13
+ )
14
+ from blue_assistant.logger import logger
15
+
16
+ NAME = module.name(__file__, NAME)
17
+
18
+ parser = argparse.ArgumentParser(NAME)
19
+ parser.add_argument(
20
+ "task",
21
+ type=str,
22
+ help="create_user | list | set | test",
23
+ )
24
+ parser.add_argument(
25
+ "--bridge_ip",
26
+ type=str,
27
+ default=env.HUE_BRIDGE_IP_ADDRESS,
28
+ )
29
+ parser.add_argument(
30
+ "--username",
31
+ type=str,
32
+ default=env.HUE_BRIDGE_USERNAME,
33
+ help="aka API key",
34
+ )
35
+ parser.add_argument(
36
+ "--light_id",
37
+ type=str,
38
+ default="",
39
+ help="all | <light_id>",
40
+ )
41
+ parser.add_argument(
42
+ "--hue",
43
+ type=int,
44
+ default=65535,
45
+ help="0 to 65535",
46
+ )
47
+ parser.add_argument(
48
+ "--saturation",
49
+ type=int,
50
+ default=254,
51
+ help="0 to 254",
52
+ )
53
+ parser.add_argument(
54
+ "--verbose",
55
+ type=int,
56
+ default=0,
57
+ help="0 | 1",
58
+ )
59
+ parser.add_argument(
60
+ "--interval",
61
+ type=float,
62
+ default=0.1,
63
+ help="in seconds",
64
+ )
65
+ args = parser.parse_args()
66
+
67
+ success = False
68
+ if args.task == "create_user":
69
+ username = create_user(
70
+ bridge_ip=args.bridge_ip,
71
+ )
72
+ if username:
73
+ success = True
74
+ elif args.task == "list":
75
+ success, _ = list_lights(
76
+ bridge_ip=args.bridge_ip,
77
+ username=args.username,
78
+ verbose=args.verbose == 1,
79
+ )
80
+ elif args.task == "set":
81
+ success = set_light_color(
82
+ bridge_ip=args.bridge_ip,
83
+ username=args.username,
84
+ light_id=args.light_id,
85
+ hue=args.hue,
86
+ saturation=args.saturation,
87
+ verbose=args.verbose == 1,
88
+ )
89
+ elif args.task == "test":
90
+ success = test(
91
+ bridge_ip=args.bridge_ip,
92
+ username=args.username,
93
+ light_id=args.light_id,
94
+ interval=args.interval,
95
+ hue=args.hue,
96
+ verbose=args.verbose == 1,
97
+ )
98
+ else:
99
+ success = None
100
+
101
+ sys_exit(logger, NAME, args.task, success)
@@ -0,0 +1,171 @@
1
+ from typing import Tuple, Dict, List
2
+ import requests
3
+ from time import sleep
4
+ from tqdm import tqdm
5
+
6
+ from blueness import module
7
+
8
+ from blue_assistant import NAME
9
+ from blue_assistant import env
10
+ from blue_assistant.logger import logger
11
+
12
+ NAME = module.name(__file__, NAME)
13
+
14
+
15
+ # hue-2025-03-14-1l8tv6
16
+ def create_user(
17
+ bridge_ip: str = env.HUE_BRIDGE_IP_ADDRESS,
18
+ wait_for_link_press: bool = True,
19
+ ) -> str:
20
+ URL = f"http://{bridge_ip}/api"
21
+
22
+ payload = {
23
+ "devicetype": "my_hue_app#python_script",
24
+ }
25
+
26
+ if wait_for_link_press:
27
+ input("Press the link button on the Hue Bridge ...")
28
+
29
+ try:
30
+ response = requests.post(URL, json=payload)
31
+
32
+ if response.status_code == 200:
33
+ result = response.json()
34
+ if "success" in result[0]:
35
+ username = result[0]["success"]["username"]
36
+ logger.info(f"created {username}")
37
+ return username
38
+
39
+ logger.error(result)
40
+ return ""
41
+
42
+ logger.error(response)
43
+ return ""
44
+ except Exception as e:
45
+ logger.error(e)
46
+ return ""
47
+
48
+
49
+ # hue-2025-03-14-4r9mgh
50
+ def list_lights(
51
+ bridge_ip: str = env.HUE_BRIDGE_IP_ADDRESS,
52
+ username: str = env.HUE_BRIDGE_USERNAME,
53
+ verbose: bool = False,
54
+ ) -> Tuple[bool, Dict]:
55
+ URL = f"http://{bridge_ip}/api/{username}"
56
+
57
+ response = requests.get(URL)
58
+
59
+ if response.status_code != 200:
60
+ logger.error(response)
61
+ return False, {}
62
+
63
+ list_of_lights = response.json()["lights"]
64
+ logger.info(
65
+ "found {} light(s): {}".format(
66
+ len(list_of_lights),
67
+ ", ".join(list_of_lights.keys()),
68
+ )
69
+ )
70
+ if verbose:
71
+ for light_id, light_info in list_of_lights.items():
72
+ logger.info(f"#{light_id}: {light_info}")
73
+
74
+ return True, list_of_lights
75
+
76
+
77
+ # hue-2025-03-13-1xjr1z
78
+ def set_light_color(
79
+ light_id: str,
80
+ hue: int, # 0 to 65535
81
+ saturation: int, # 0 to 254
82
+ bridge_ip: str = env.HUE_BRIDGE_IP_ADDRESS,
83
+ username: str = env.HUE_BRIDGE_USERNAME,
84
+ verbose: bool = False,
85
+ ) -> bool:
86
+ logger.info(
87
+ "{}.set_light_color({}@{}:{}) -> hue=0x{:x}, saturation=0x{:x}".format(
88
+ NAME,
89
+ username,
90
+ bridge_ip,
91
+ light_id,
92
+ hue,
93
+ saturation,
94
+ )
95
+ )
96
+
97
+ # Construct the API endpoint URL
98
+ url = f"http://{bridge_ip}/api/{username}/lights/{light_id}/state"
99
+
100
+ # Prepare the payload with the desired hue and saturation
101
+ payload = {
102
+ "hue": hue,
103
+ "sat": saturation,
104
+ }
105
+
106
+ response = requests.put(url, json=payload)
107
+
108
+ # https://chat.openai.com/c/6deb94d0-826a-48de-b5ef-f7d8da416c82
109
+ # response.raise_for_status()
110
+ if response.status_code // 100 != 2:
111
+ logger.error(response)
112
+ return False
113
+
114
+ if verbose:
115
+ logger.info(response.json())
116
+
117
+ return True
118
+
119
+
120
+ def test(
121
+ hue: int,
122
+ light_id: str = "all",
123
+ interval: float = 0.1,
124
+ bridge_ip: str = env.HUE_BRIDGE_IP_ADDRESS,
125
+ username: str = env.HUE_BRIDGE_USERNAME,
126
+ verbose: bool = False,
127
+ ) -> bool:
128
+ if not light_id:
129
+ light_id = "all"
130
+
131
+ logger.info(
132
+ "{}.test({}@{}:{}) @ hue=0x{:x}, interval={} s".format(
133
+ NAME,
134
+ username,
135
+ bridge_ip,
136
+ light_id,
137
+ hue,
138
+ interval,
139
+ )
140
+ )
141
+
142
+ list_of_lights: List[str]
143
+ if light_id == "all":
144
+ success, dict_of_lights = list_lights(
145
+ bridge_ip=bridge_ip,
146
+ username=username,
147
+ verbose=verbose,
148
+ )
149
+ if not success:
150
+ return success
151
+ list_of_lights = list(dict_of_lights.keys())
152
+ else:
153
+ list_of_lights = [light_id]
154
+
155
+ saturation = 0
156
+ while True:
157
+ for light_id_ in tqdm(list_of_lights):
158
+ set_light_color(
159
+ light_id=light_id_,
160
+ hue=hue,
161
+ saturation=saturation,
162
+ bridge_ip=bridge_ip,
163
+ username=username,
164
+ verbose=verbose,
165
+ )
166
+
167
+ sleep(interval)
168
+
169
+ saturation = 254 - saturation
170
+
171
+ return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_assistant
3
- Version: 4.182.1
3
+ Version: 4.221.1
4
4
  Summary: 🧠 An AI Assistant.
5
5
  Home-page: https://github.com/kamangir/blue-assistant
6
6
  Author: Arash Abadpour (Kamangir)
@@ -62,6 +62,7 @@ graph LR
62
62
  url["🔗 url"]:::folder
63
63
  object["📂 object"]:::folder
64
64
 
65
+
65
66
  script --> assistant_script_list
66
67
 
67
68
  script --> assistant_script_run
@@ -71,12 +72,39 @@ graph LR
71
72
  url --> assistant_web_crawl
72
73
  assistant_web_crawl --> object
73
74
 
75
+
76
+ bridge_ip["🔗 bridge_ip"]:::folder
77
+ hue_username["🔗 hue_username"]:::folder
78
+ list_of_lights["💡 light IDs"]:::folder
79
+
80
+ hue_create_user["@hue<br>create_user"]
81
+ hue_list["@hue<br>list"]
82
+ hue_set["@hue<br>set"]
83
+ hue_test["@hue<br>test"]
84
+
85
+ bridge_ip --> hue_create_user
86
+ hue_create_user --> hue_username
87
+
88
+ bridge_ip --> hue_list
89
+ hue_username --> hue_list
90
+ hue_list --> list_of_lights
91
+
92
+ bridge_ip --> hue_set
93
+ hue_username --> hue_set
94
+ list_of_lights --> hue_set
95
+
96
+ bridge_ip --> hue_test
97
+ hue_username --> hue_test
98
+ list_of_lights --> hue_test
99
+
100
+
101
+
74
102
  classDef folder fill:#999,stroke:#333,stroke-width:2px;
75
103
  ```
76
104
 
77
105
  | | |
78
106
  | --- | --- |
79
- | [`hue`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) [![image](https://github.com/kamangir/assets/blob/main/blue-assistant/hue.jpg?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) "send a color command to the Hue LED lights in my apartment." 🔥 | [`blue-amo`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) [![image](https://github.com/kamangir/assets/raw/main/blue-amo-2025-02-03-nswnx6/stitching_the_frames-2.png?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) A story developed and visualized, by AI. |
107
+ | [`hue`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) [![image](https://github.com/kamangir/assets/raw/main/blue-assistant/20250314_143702.jpg?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/hue) "send a color command to the Hue LED lights in my apartment." | [`blue-amo`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) [![image](https://github.com/kamangir/assets/raw/main/blue-amo-2025-02-03-nswnx6/stitching_the_frames-2.png?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/blue_amo/README.md) A story developed and visualized, by AI. |
80
108
  | [`orbital-data-explorer`](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/orbital_data_explorer/README.md) [![image](https://github.com/kamangir/assets/blob/main/blue-assistant/orbital-data-explorer.png?raw=true)](https://raw.githubusercontent.com/kamangir/blue-assistant/main/blue_assistant/script/repository/orbital_data_explorer/README.md) Access to the [Orbital Data Explorer](https://ode.rsl.wustl.edu/), through AI. ⏸️ | |
81
109
 
82
110
  ---
@@ -84,4 +112,4 @@ graph LR
84
112
 
85
113
  [![pylint](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-assistant.svg)](https://pypi.org/project/blue-assistant/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-assistant)](https://pypistats.org/packages/blue-assistant)
86
114
 
87
- built by 🌀 [`blue_options-4.234.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.182.1`](https://github.com/kamangir/blue-assistant).
115
+ built by 🌀 [`blue_options-4.234.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.221.1`](https://github.com/kamangir/blue-assistant).
@@ -24,8 +24,12 @@ blue_assistant/.abcli/actions.sh
24
24
  blue_assistant/.abcli/alias.sh
25
25
  blue_assistant/.abcli/blue_assistant.sh
26
26
  blue_assistant/.abcli/browse.sh
27
+ blue_assistant/.abcli/hue.sh
27
28
  blue_assistant/.abcli/script.sh
28
29
  blue_assistant/.abcli/web.sh
30
+ blue_assistant/.abcli/hue/create_user.sh
31
+ blue_assistant/.abcli/hue/list.sh
32
+ blue_assistant/.abcli/hue/set.sh
29
33
  blue_assistant/.abcli/script/list.sh
30
34
  blue_assistant/.abcli/script/run.sh
31
35
  blue_assistant/.abcli/tests/README.sh
@@ -38,6 +42,7 @@ blue_assistant/.abcli/web/crawl.sh
38
42
  blue_assistant/help/__init__.py
39
43
  blue_assistant/help/__main__.py
40
44
  blue_assistant/help/functions.py
45
+ blue_assistant/help/hue.py
41
46
  blue_assistant/help/script.py
42
47
  blue_assistant/help/web.py
43
48
  blue_assistant/script/__init__.py
@@ -58,7 +63,9 @@ blue_assistant/script/repository/blue_amo/actions/stitching_the_frames.py
58
63
  blue_assistant/script/repository/generic/__init__.py
59
64
  blue_assistant/script/repository/generic/classes.py
60
65
  blue_assistant/script/repository/hue/__init__.py
66
+ blue_assistant/script/repository/hue/__main__.py
61
67
  blue_assistant/script/repository/hue/classes.py
68
+ blue_assistant/script/repository/hue/functions.py
62
69
  blue_assistant/script/repository/orbital_data_explorer/__init__.py
63
70
  blue_assistant/script/repository/orbital_data_explorer/classes.py
64
71
  blue_assistant/script/repository/orbital_data_explorer/actions/__init__.py
@@ -1,33 +0,0 @@
1
- import os
2
- from blue_options.env import load_config, load_env
3
-
4
- load_env(__name__)
5
- load_config(__name__)
6
-
7
-
8
- BLUE_ASSISTANT_TEXT_DEFAULT_MODEL = os.getenv(
9
- "BLUE_ASSISTANT_TEXT_DEFAULT_MODEL",
10
- "",
11
- )
12
-
13
- BLUE_ASSISTANT_TEXT_MAX_TOKENS_str = os.getenv("BLUE_ASSISTANT_TEXT_MAX_TOKENS", "")
14
- try:
15
- BLUE_ASSISTANT_TEXT_MAX_TOKENS = int(BLUE_ASSISTANT_TEXT_MAX_TOKENS_str)
16
- except Exception:
17
- BLUE_ASSISTANT_TEXT_MAX_TOKENS = 2000
18
-
19
-
20
- BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL = os.getenv(
21
- "BLUE_ASSISTANT_IMAGE_DEFAULT_MODEL",
22
- "",
23
- )
24
-
25
- BLUE_ASSISTANT_IMAGE_DEFAULT_QUALITY = os.getenv(
26
- "BLUE_ASSISTANT_IMAGE_DEFAULT_QUALITY",
27
- "",
28
- )
29
-
30
- BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE = os.getenv(
31
- "BLUE_ASSISTANT_IMAGE_DEFAULT_SIZE",
32
- "",
33
- )
File without changes