Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home-assistant-custom-components.dreame-vacuum: init at 1.0.4, python312Packages.py-mini-racer: init at 0.6.0 #356473

Closed
wants to merge 2 commits into from

Conversation

Golbinex
Copy link
Contributor

Adds dreame-vacuum custom component for controlling Dreame Robots.
Also adds py-mini-racer python library which is required by dreame-vacuum.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@Golbinex
Copy link
Contributor Author

nixpkgs-review output:
5 packages built: home-assistant-custom-components.dreame-vacuum python311Packages.py-mini-racer python311Packages.py-mini-racer.dist python312Packages.py-mini-racer python312Packages.py-mini-racer.dist

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Nov 17, 2024
@Golbinex
Copy link
Contributor Author

@mweinelt @natsukium Bumping this PR


buildPythonPackage rec {
pname = "py-mini-racer";
version = "0.6.0";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version = "0.6.0";
version = "0.6.0";
pyproject = true;

and configure build-system.

Comment on lines +14 to +15
rev = "v${version}";
sha256 = "sha256-r6ghH1uPbnM4cruxgcOkHv3HsC29p3fILtH3Mzpy8yQ=";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "v${version}";
sha256 = "sha256-r6ghH1uPbnM4cruxgcOkHv3HsC29p3fILtH3Mzpy8yQ=";
tag = "v${version}";
hash = "sha256-r6ghH1uPbnM4cruxgcOkHv3HsC29p3fILtH3Mzpy8yQ=";

Comment on lines +12 to +13
owner = "sqreen";
repo = "PyMiniRacer";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repository is deprecated. The successor is https://github.com/bpcreech/PyMiniRacer.

sha256 = "sha256-r6ghH1uPbnM4cruxgcOkHv3HsC29p3fILtH3Mzpy8yQ=";
};

doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable tests.

src = fetchFromGitHub {
inherit owner;
repo = "dreame-vacuum";
rev = "v${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "v${version}";
tag = "v${version}";

lib,
buildHomeAssistantComponent,
fetchFromGitHub,
python312Packages,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never consume python312Packages in home-assistant-custom-components. You must consume the same package set that home-assistant provides. To that end you can just consume the dependencies up here.

Suggested change
python312Packages,
numpy,
pillow,
...,

And please sort this list.

hash = "sha256-LeKD2dIeC/TsOl3Q2TLFQy7RjzbRwYmvKUUm3JVsz8E=";
};

propagatedBuildInputs = with python312Packages; [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
propagatedBuildInputs = with python312Packages; [
dependencies = [

Comment on lines +21 to +29
pillow
numpy
pybase64
requests
pycryptodome
python-miio
py-mini-racer
tzlocal
paho-mqtt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort.

@mweinelt
Copy link
Member

The cherry on top is that this package requires a native v8 library, that is built as part of the release process with no security guarantees at all.

@mweinelt
Copy link
Member

Can I suggest you look into https://github.com/Hypfer/Valetudo instead? 🤔

@Golbinex
Copy link
Contributor Author

Golbinex commented Jan 13, 2025

I wanted to avoid flashing robot firmware since it requires a custom PCB board and this component works locally too although without map support.
But if there are security problems with this component, then I will eventually switch to Valetudo anyway.

@Golbinex Golbinex closed this Jan 13, 2025
@mweinelt
Copy link
Member

Shoot. I have this PCB in our hackerspace, but we're probably hundreds of kilometers apart.

@Golbinex
Copy link
Contributor Author

Czech Republic is not far from Germany but I don't feel like taking a trip just for this PCB 😅
However if you have any spare or unused PCB board that you're willing to sell, it could be sent for 3,3 - 6,5€ as a letter via Deutsche Post.

@mweinelt
Copy link
Member

Unfortunately it is not a spare part and we only have the one. Every other month somebody comes by to use it to flash their new vacuum here. I suggest asking around hacker- and maker spaces in the Czech Republic or on Valetudo's Telegram group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants