Skip to content

Many changes - #176

Merged
rneswold merged 50 commits into
DrMemCS:mainfrom
rneswold:PR
Aug 15, 2026
Merged

rneswold merged 50 commits into
DrMemCS:mainfrom
rneswold:PR

Conversation

@rneswold

Copy link
Copy Markdown
Contributor

This is a large set of unrelated changes that I've worked on the past 2 months. I have more changes planned, but I'll add them in separate PRs. This PR includes:

  • Revamp Hue driver
  • Add temperature to Color type
  • Add color functions to logic block grammar
  • Switch to async-graphql and axum
  • Use modern module layout
  • Remove use of Cow<>
  • Bug fix in logic blocks (fix comparison)

These changes should have been in separate PRs.

I'm running DrMem on a NetBSD 9.0/aarch64 system, which doesn't have
the `getentropy()` call. This commit forces `reqwest` to use the
`ring` crate.
My system doesn't have support for the `aws-lc-sys` crate yet. This
commit rolls back usage or the `reqwest` crate to v0.11.
The expression evaluators are recursive and the compiler may try
to inline them. This tells it not to inline the at all, which is
the start of improving linking times.
There is a bug in the look-up predicate in the map driver. This
unit test exposes the bug.
Marked several functions that use generics as `#[inline(never)]`. The
thought is that these functions are created over and over and the
linker has to merge them together.
When building a dev target, use the simple backend.
The handler for the hue devices inlined too much code. This splits it
out into simpler helper functions.
- Add to AGENT,md
- Defined `cargo` features to specify
The Hue dimmer readings weren't being reported as whole numbers so they
weren't comparing properly with the previous settings. This rounds
everything to the nearest whole numner so the comparisons succeed.
This was done with the help of Claude sonnet-4.6.

- Removed the streaming event interface; is only reported changing
  fields so turning bulbs on and off didn't report the dimmer value
  which totally broke the `OverridavleDevice` logic.
- Now the device support tasks poll their state every 5 seconds
Also, don't return `None`. Instead, wait for more settings.
This is the merged commit of several session with Claude code. It moves
away from the `juniper`/`warp` ecosystem to the `async-graphql`/`axum`
solution.

I've used `acsync-graphql` on a project at work and it is a much nicer
implementation. `axum` also seems to be cleaner and better organized.

I've been meaning to do this migration for quite some time, but I knew
it would take a lot of effort with no visible difference so I kept
putting it off. I was amazed how well -- and quickly! --
claude-sonnet-4.6 was able to do the migrations. There were minor tweaks
after its initial effort but to be able to do this in an evening instead
of a week, or so, is incredible.
rneswold added 20 commits July 3, 2026 10:01
- Try to reduce token count
- Fix command to use for validating code changes
The function is used one way, so use `impl` instead of generics.
The Hue bulbs specify color in XY space but DrMem uses RGB(A) values.
When we receive updates from the bulb and convert it to RGB, we don't
necessarily get the same value that we used to set the color. The
floating point conversion can round the result so the driver gets in an
infinite loop of setting the bulb color.

This commit changes the ColorBulb struct to save the XY value.

- When a setting comes in, it's converted to XY
- The XY is sent to the bulb and saved in the structure
- When polling the bulb, the XY value is compared (with 0.001 accuracy)
- When writing to the backend, it's converted to RGB
After some back and forth with Copilot, the Color type has now been
expanded. It can specify either RGB color or white point temperature.
The grammar has been modified to support "#nnnK".
This function takes two areguments, a `Color` and a replacement alpha
channel value.
This function takes a `Color` as an argument and returns the perceived
brightness of it.
BLEND() takes a variable number of arguments, each should be a `Color`
type. It returns a color equal to blending the colors together. The last
parameter is considered the color at the "bottom layer". The first
parameter is the topmost layer.
There was a small chance (which happened once!) that the timestamps
were the same and the unit test returned the wrong value.
When we switched to `axum`, the paths weren't quite right. This commit
fixes those errors and adds unit tests to make sure they don't break
in the future.
- add `instrument` attributes to resolvers
- log warnings for authorization errors
When temperature colors were added, I forgot to add Redis support.
This commit serializes temperature values to and from Redis as well as
adding unit tests.
- remove dependency on `lazy_static`
- remove redundant use of `format!`
The `graphiql` feature pulls in the `graphql` feature so include
`graphiql` to make sure everything builds correctly.
The override timeout wasn't working. This fixes the bug.
@rneswold
rneswold merged commit 4ce9e2c into DrMemCS:main Aug 15, 2026
3 checks passed
@rneswold
rneswold deleted the PR branch August 15, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant