Commit 5c04d03a authored by Jakob Moser's avatar Jakob Moser
Browse files

Merge branch 'chore/polish-rough-edges' into 'master'

Polish a few rough edges

Closes #23

See merge request moser/poolpay!30
parents 23ad3bba 505b2e91
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ Then, connect the cables to the Pi as described in this chart:
- [Instructions (en)](https://cdn-reichelt.de/documents/datenblatt/C300/SBC-RFID-RC522-MANUAL-08-07-2019.pdf)
- [How to enable SPI0 and SPI1 at the same time](https://raspberrypi.stackexchange.com/questions/73346/how-to-enable-spi1-and-spi0-at-the-same-time)
- [SPI pinout map](https://pinout.xyz/pinout/spi)

</details>

### WiFi hotspot
@@ -145,6 +146,7 @@ Then, connect the cables to the Pi as described in this chart:
- [RB-TFT3.5 Manual (German)](https://joy-it.net/files/files/Produkte/RB-TFT3.5/RB-TFT-Anleitung_04082020.pdf)
- [Frame Buffer Kernel Docs](https://www.kernel.org/doc/html/latest/fb/fbcon.html)
- [FBTFT docs](https://learn.watterott.com/de/hats/rpi-display/fbtft-install/) (they mention something about the touchscreen, connection speed, latency etc.)

</details>

### Software
+2 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ if not vault.is_open:
    password = get_password()
else:
    print("🔓 The PoolPay database is already [green]unlocked[/green].")
    password = None

match args.action:
    case "ui":
@@ -42,5 +43,6 @@ match args.action:
            finally:
                db.close()
    case "unlock":
        if password is not None:
            with Client(socket_path) as c:
                c.send({"action": "unlock", "password": password})
+7 −4
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ from os import getgid, getuid
from pathlib import Path
from subprocess import CalledProcessError, run
from typing import Any, Self
from uuid import uuid4


@dataclass(frozen=True)
@@ -12,9 +11,13 @@ class Vault(AbstractContextManager):
    image: Path
    mountpoint: Path

    # The name is not part of the interface, but we need to remember it during command execution, because it will be
    # identified by the operating system using this name
    _name: str = f"poolpay-vault-{uuid4()}"
    @property
    def _name(self) -> str:
        """
        Return the name the operating system shall use to identify this vault.
        """
        distinguisher = str(self.image.resolve()).replace("/", "-")
        return f"poolpay-vault-{distinguisher}"

    @property
    def _mapper(self) -> Path: