Skip to content

Commit

Permalink
feat: get_chordmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
GetPsyched committed Jan 15, 2024
1 parent 7d01a7a commit 3cb0c26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion charachorder/device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Literal, NamedTuple
from typing import TYPE_CHECKING, Generator, Literal, NamedTuple

from serial import Serial
from serial.tools import list_ports
Expand Down Expand Up @@ -216,6 +216,12 @@ def get_available_ram(self) -> int:
def sim(self, subcommand: str, value: str) -> str:
return self.execute("SIM", subcommand, value)[0]

# Misc. custom abstractions

def get_chordmaps(self) -> Generator[tuple[Chord, ChordPhrase], None, None]:
chordmap_count = self.get_chordmap_count()
return (self.get_chordmap(i) for i in range(chordmap_count))


@allowed_product_ids(0x800F) # M0
class CharaChorderOne(CharaChorder):
Expand Down

0 comments on commit 3cb0c26

Please sign in to comment.