ruby-blinkstick 0.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 85096144b5f714b5b78ef9d96a9ec8704cc01773d70939eb40580039840ccd06
4
+ data.tar.gz: b376b8f3977442266b3073228f907207768753ed5c67760358b3f675190851e6
5
+ SHA512:
6
+ metadata.gz: 119497122ba34c45749af7168fe0575354ca2ebbe441a0bf959e912991d32ea56631b6eca2a7c470c6f412548aededbdf12327195bff3d1530cbdd13e1fadfd4
7
+ data.tar.gz: 2c465dfb6b3e0db1948609c1dc973144aad7db58d74cd1613852b7dc2b3467d3cd861070fb2f279b0f4dc11e822c939f6c327eaf9cb40ccd9c3efe579a41d5f0
data/CAPABILITIES.md ADDED
@@ -0,0 +1,64 @@
1
+ # Capabilities
2
+
3
+ 0.0.1 is a placeholder and supports nothing. This table is the checklist for the implementation.
4
+
5
+ What the BlinkStick Nano and Square can do, and what this gem supports so far. Back to the
6
+ [README](README.md).
7
+
8
+ This file is updated whenever a feature lands.
9
+
10
+ Key: **yes** supported, **no** not yet, **n/a** the device does not have it, **unverified** the
11
+ device may have it but it has not been confirmed on hardware.
12
+
13
+ ## Device features
14
+
15
+ Features built into the BlinkStick firmware.
16
+
17
+ | Feature | Nano | Square | Supported since | Notes |
18
+ |---|---|---|---|---|
19
+ | List attached sticks | no | no | not yet | Enumerate every attached stick |
20
+ | Open the first stick or one by serial | no | no | not yet | Open the first stick found, or a stick by its serial |
21
+ | Name a stick and open it by name | no | no | not yet | Store a name, read it back, open and list sticks by name. Stored in info block 1 |
22
+ | Several sticks open at once | no | no | not yet | |
23
+ | Serial and firmware version | no | no | not yet | Read from the device info |
24
+ | Manufacturer and product strings | no | no | not yet | Read from the device info |
25
+ | Set all LEDs | no | no | not yet | Set every LED to one colour, or turn them off |
26
+ | Set one LED | no | no | not yet | Set a single LED by index, using report 5 |
27
+ | Set every LED at once | no | no | not yet | Write a whole frame in one report |
28
+ | Read LED values back | no | no | not yet | Read the whole frame or a single LED |
29
+ | Info blocks 1 and 2 | no | no | not yet | Read and write the info blocks. 32 bytes each, stored in EEPROM |
30
+ | Set one LED directly (report 5) | no | no | not yet | `[5, channel, index, R, G, B]`, RGB order (the frame is GRB). Works in modes 2 and 3. The channel byte is ignored and the index is not range checked |
31
+ | Read device mode (report 4) | no | no | not yet | `[4, mode]`. Both read mode 2 |
32
+ | Set device mode (report 4) | no | no | not yet | Stored in EEPROM, blocks about 50 ms, skipped when the mode is unchanged, takes effect without a replug. 2 to 3 to 2 verified on both |
33
+ | Mode 2, WS2812 | no | no | not yet | The mode both are in, and the one every LED feature here needs. Probably the factory default |
34
+ | Mode 3, WS2812 mirror | no | no | not yet | Changes only report 1, whose colour goes to every LED. Reports 5 and 6 behave as in mode 2 |
35
+ | Modes 0 and 1, normal and inverse | n/a | n/a | n/a | For the BlinkStick Pro's RGB outputs. Upstream reports a Nano in mode 1 going dark until replugged. Setting the mode refuses them |
36
+ | Set LED 0, or every LED in mode 3 (report 1) | no | no | not yet | `[1, R, G, B]`, RGB order. Used by other BlinkStick software. Setting LED 0 or all LEDs does the same job in either mode |
37
+ | Report 10 | n/a | unknown | no | Square only, 2 bytes, reads 00 00. Undocumented; waiting on the manufacturer |
38
+ | LED count setting (report 0x81) | n/a | n/a | n/a | BlinkStick Flex only |
39
+ | 16, 32 and 64 LED frames (reports 7 to 9) | n/a | n/a | n/a | For longer strips |
40
+
41
+ ## Host features
42
+
43
+ Features this gem adds in software. They work the same on every supported device.
44
+
45
+ | Feature | Supported since | Notes |
46
+ |---|---|---|
47
+ | Model detection | not yet | From the serial and USB release number |
48
+ | Colour from hex or `r,g,b` | not yet | Parse a colour from hex, with or without the `#`, or `r,g,b` |
49
+ | Brightness limit | not yet | Cap the brightness of every colour written |
50
+ | Blink, pulse and morph | not yet | Cancellable |
51
+ | CSS colour names | not yet | All 148 from CSS Color Level 4 |
52
+ | List CSS colour names | not yet | Sorted, for shell completion |
53
+ | Colour as hex | not yet | Lower case `#rrggbb` |
54
+ | Random colour | not yet | Any colour, or a vivid one |
55
+ | Inverse colours | not yet | Invert a colour or the whole frame. Not the firmware inverse mode |
56
+ | Reconnect after unplug | not yet | Automatic, repaints the last frame |
57
+
58
+ ## Platforms
59
+
60
+ | Platform | Supported since |
61
+ |---|---|
62
+ | macOS | not yet |
63
+ | Linux | not yet |
64
+ | Windows | no |
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are recorded here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
5
+ [semantic versioning](https://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.0.1] - 2026-10-28
10
+
11
+ ### Added
12
+
13
+ - Reserved the `ruby-blinkstick` gem name. This release defines `Blinkstick::VERSION` and nothing else.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Keith Bawden
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # ruby-blinkstick
2
+
3
+ [![CI](https://github.com/bawdo/ruby-blinkstick/actions/workflows/ci.yml/badge.svg)](https://github.com/bawdo/ruby-blinkstick/actions/workflows/ci.yml)
4
+ [![Gem](https://img.shields.io/gem/v/ruby-blinkstick)](https://rubygems.org/gems/ruby-blinkstick)
5
+ [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/bawdo/ruby-blinkstick/badge)](https://scorecard.dev/viewer/?uri=github.com/bawdo/ruby-blinkstick)
6
+ [![codecov](https://codecov.io/gh/bawdo/ruby-blinkstick/branch/main/graph/badge.svg)](https://codecov.io/gh/bawdo/ruby-blinkstick)
7
+
8
+ Drive BlinkStick Nano and Square USB LEDs from Ruby.
9
+
10
+ This gem is unofficial. It is not made by, or affiliated with, Agile Innovative, the makers
11
+ of BlinkStick.
12
+
13
+ ## Status
14
+
15
+ `0.0.1` reserves the gem name and does nothing else. The implementation will port
16
+ [go-blinkstick](https://github.com/bawdo/go-blinkstick). See [CAPABILITIES.md](CAPABILITIES.md)
17
+ for the features it will cover.
18
+
19
+ ## Install
20
+
21
+ ```sh
22
+ gem install ruby-blinkstick
23
+ ```
24
+
25
+ Or in a Gemfile:
26
+
27
+ ```ruby
28
+ gem "ruby-blinkstick"
29
+ ```
30
+
31
+ The gem is called `ruby-blinkstick` because `blinkstick` was already taken on rubygems.org, so
32
+ you `require "blinkstick"` and use the `Blinkstick` module.
33
+
34
+ ## Requirements
35
+
36
+ - Ruby 3.4 or later.
37
+
38
+ ## Linux
39
+
40
+ BlinkStick devices are owned by root by default, so opening one needs a udev rule. Install the
41
+ one shipped with this gem:
42
+
43
+ ```sh
44
+ sudo cp udev/60-blinkstick.rules /etc/udev/rules.d/
45
+ sudo udevadm control --reload-rules
46
+ sudo udevadm trigger
47
+ ```
48
+
49
+ Then unplug and replug the stick (or reboot). This grants access to whoever is logged in at the
50
+ desktop (via systemd-logind's `uaccess`), not a udev group, so no group membership or new login
51
+ session is needed beyond replugging the device.
52
+
53
+ The rule only grants the `hidraw` node, which is all this gem uses. If you use a tool that talks
54
+ to the stick through libusb (such as the official Python `blinkstick` package), add this line to
55
+ the rule as well:
56
+
57
+ ```
58
+ SUBSYSTEM=="usb", ATTR{idVendor}=="20a0", ATTR{idProduct}=="41e5", TAG+="uaccess"
59
+ ```
60
+
61
+ ## Licence
62
+
63
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Blinkstick
4
+ VERSION = "0.0.1"
5
+ end
data/lib/blinkstick.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "blinkstick/version"
4
+
5
+ # 0.0.1 is a placeholder that reserves the gem name and does nothing.
6
+ module Blinkstick
7
+ end
@@ -0,0 +1,13 @@
1
+ # Grants the logged-in desktop user access to BlinkStick hidraw nodes, so
2
+ # this gem can open them without root or a udev group. It does not grant
3
+ # raw USB access; see README.md#linux if another tool needs that.
4
+ #
5
+ # Install:
6
+ # sudo cp udev/60-blinkstick.rules /etc/udev/rules.d/
7
+ # sudo udevadm control --reload-rules
8
+ # sudo udevadm trigger
9
+ #
10
+ # Then unplug and replug the stick (or reboot). See README.md#linux for
11
+ # details.
12
+
13
+ KERNEL=="hidraw*", ATTRS{idVendor}=="20a0", ATTRS{idProduct}=="41e5", TAG+="uaccess"
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-blinkstick
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Keith Bawden
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Drive BlinkStick Nano and Square USB LEDs from Ruby. Unofficial, and
13
+ not affiliated with Agile Innovative. 0.0.1 is a placeholder that reserves the gem
14
+ name.
15
+ email:
16
+ - keith@arrix.com.au
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - CAPABILITIES.md
22
+ - CHANGELOG.md
23
+ - LICENSE
24
+ - README.md
25
+ - lib/blinkstick.rb
26
+ - lib/blinkstick/version.rb
27
+ - udev/60-blinkstick.rules
28
+ homepage: https://github.com/bawdo/ruby-blinkstick
29
+ licenses:
30
+ - MIT
31
+ metadata:
32
+ source_code_uri: https://github.com/bawdo/ruby-blinkstick
33
+ changelog_uri: https://github.com/bawdo/ruby-blinkstick/blob/main/CHANGELOG.md
34
+ bug_tracker_uri: https://github.com/bawdo/ruby-blinkstick/issues
35
+ rubygems_mfa_required: 'true'
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '3.4'
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubygems_version: 3.6.9
51
+ specification_version: 4
52
+ summary: Drive BlinkStick Nano and Square USB LEDs from Ruby.
53
+ test_files: []