mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-21 23:54:22 +01:00
Better pin zigbee dongle serial device
Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
parent
8f052ce05f
commit
2b11913dc9
|
@ -98,6 +98,19 @@ in
|
|||
system.stateVersion = "21.05";
|
||||
|
||||
boot.kernel.sysctl."fs.inotify.max_user_instances" = 256;
|
||||
services.udev.extraRules =
|
||||
let
|
||||
devPath =
|
||||
"/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_4c004e9c53c9eb118a9f8b4f1d69213e-if00-port0";
|
||||
zigbeeScript = pkgs.writeShellScript "zigbeeScript" ''
|
||||
${pkgs.lib.getExe' pkgs.utillinux "mount"} --bind \
|
||||
"$(${pkgs.lib.getExe' pkgs.coreutils "readlink"} -f "${devPath}")" \
|
||||
/dev/ttyZigbee
|
||||
'';
|
||||
in
|
||||
''
|
||||
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea60", RUN+="${zigbeeScript}"
|
||||
'';
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ job "home-assistant" {
|
|||
|
||||
devices = [
|
||||
{
|
||||
host_path = "/dev/ttyUSB0" #"serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_4c004e9c53c9eb118a9f8b4f1d69213e-if00-port0"
|
||||
host_path = "/dev/ttyZigbee" #"serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_4c004e9c53c9eb118a9f8b4f1d69213e-if00-port0"
|
||||
container_path = "/dev/ttyUSB0"
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue