Skip to content

Commit 37d1302

Browse files
committed
[TagVal] Change serial number from integer to string
1 parent 4b2d336 commit 37d1302

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tcmenu/remote/commands/command_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CommandFactory:
5454

5555
@staticmethod
5656
def new_join_command(
57-
name: str, uuid: Optional[UUID] = None, serial_number: Optional[int] = None
57+
name: str, uuid: Optional[UUID] = None, serial_number: Optional[str] = None
5858
) -> MenuJoinCommand:
5959
"""
6060
Create a new join command. You can either provide a fixed UUID

tcmenu/remote/commands/menu_join_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class MenuJoinCommand(MenuCommand):
1717

1818
app_uuid: uuid.UUID = uuid.uuid4()
1919

20-
serial_number: int = 999999999
20+
serial_number: str = "999999999"
2121

2222
@property
2323
def command_type(self) -> MessageField:

test/remote/commands/test_menu_join_command.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_menu_join_command_random_uuid():
1414
assert command.my_name == "Android Phone"
1515
assert type(command.api_version) == int
1616
assert command.platform == ApiPlatform.PYTHON_API
17-
assert command.serial_number == 999999999
17+
assert command.serial_number == "999999999"
1818

1919

2020
def test_menu_join_command_fixed_uuid():
@@ -28,16 +28,16 @@ def test_menu_join_command_fixed_uuid():
2828
assert command.my_name == "Android Phone"
2929
assert type(command.api_version) == int
3030
assert command.platform == ApiPlatform.PYTHON_API
31-
assert command.serial_number == 999999999
31+
assert command.serial_number == "999999999"
3232

3333

3434
def test_menu_join_command_custom_serial_number():
35-
command = CommandFactory.new_join_command(name="Android Phone", serial_number=55441233)
35+
command = CommandFactory.new_join_command(name="Android Phone", serial_number="55441233")
3636
assert isinstance(command.app_uuid, uuid.UUID)
3737
assert isinstance(command.command_type, MessageField) is True
3838
assert command.command_type.id == "NJ"
3939

4040
assert command.my_name == "Android Phone"
4141
assert type(command.api_version) == int
4242
assert command.platform == ApiPlatform.PYTHON_API
43-
assert command.serial_number == 55441233
43+
assert command.serial_number == "55441233"

0 commit comments

Comments
 (0)