Skip to content

Commit d4fec4c

Browse files
committed
Rename connection module to tt6_connection
1 parent 9ea7667 commit d4fec4c

8 files changed

+10
-10
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Known to work with a GANA USB to RS-232 DB9 cable on Windows 10 and on Raspbian
2222

2323
## Opening a connection
2424

25-
`nicett6.connection.open([serial_port])` opens a connection to the TT6 controlled connected to `serial_port`
25+
`nicett6.tt6_connection.open([serial_port])` opens a connection to the TT6 controlled connected to `serial_port`
2626

27-
`nicett6.connection.open_connection([serial_port])` opens a connection and acts as an async context manager
27+
`nicett6.tt6_connection.open_connection([serial_port])` opens a connection and acts as an async context manager
2828

2929
If `serial_port` is not supplied or is `None` then an intelligent guess will be made as to the right parameter depending on the platform
3030

example2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import logging
33

4-
from nicett6.connection import open_connection
4+
from nicett6.tt6_connection import open_connection
55
from nicett6.ttbus_device import TTBusDeviceAddress
66
from nicett6.utils import parse_example_args, run_coro_after_delay
77

movement_timing_logger.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import logging
44
from datetime import datetime, timedelta
55

6-
from nicett6.connection import TT6Reader
76
from nicett6.cover import Cover
87
from nicett6.cover_manager import CoverManager
98
from nicett6.decode import PctAckResponse, PctPosResponse
9+
from nicett6.tt6_connection import TT6Reader
1010
from nicett6.ttbus_device import TTBusDeviceAddress
1111

1212
_LOGGER = logging.getLogger(__name__)

nicett6/cover_manager.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import logging
22
from typing import Dict, Optional
33

4-
from nicett6.connection import TT6Connection, TT6Reader, TT6Writer
5-
from nicett6.connection import open as open_tt6
64
from nicett6.cover import Cover
75
from nicett6.decode import (
86
AckResponse,
@@ -11,6 +9,8 @@
119
PctPosResponse,
1210
ResponseMessageType,
1311
)
12+
from nicett6.tt6_connection import TT6Connection, TT6Reader, TT6Writer
13+
from nicett6.tt6_connection import open as open_tt6
1414
from nicett6.tt6_cover import TT6Cover
1515
from nicett6.ttbus_device import TTBusDeviceAddress
1616

File renamed without changes.

nicett6/tt6_cover.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from dataclasses import dataclass
33

44
from nicett6.command_code import CommandCode
5-
from nicett6.connection import TT6Writer
65
from nicett6.cover import Cover
76
from nicett6.decode import (
87
AckResponse,
@@ -11,6 +10,7 @@
1110
PctPosResponse,
1211
ResponseMessageType,
1312
)
13+
from nicett6.tt6_connection import TT6Writer
1414
from nicett6.ttbus_device import TTBusDeviceAddress
1515

1616
_LOGGER = logging.getLogger(__name__)

tests/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from asyncio import sleep as asyncio_sleep
33
from unittest.mock import AsyncMock, MagicMock
44

5-
from nicett6.connection import TT6Reader, TT6Writer
5+
from nicett6.tt6_connection import TT6Reader, TT6Writer
66

77

88
def make_mock_conn(reader_return_value):

tests/test_connection.py tests/test_tt6_connection.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
from unittest.mock import AsyncMock, patch
55

66
from nicett6.command_code import CommandCode
7-
from nicett6.connection import TT6Connection, TT6Writer, open_connection
87
from nicett6.consts import RCV_EOL
98
from nicett6.decode import AckResponse, ResponseMessageType
109
from nicett6.multiplexer import MultiplexerProtocol
10+
from nicett6.tt6_connection import TT6Connection, TT6Writer, open_connection
1111
from nicett6.ttbus_device import TTBusDeviceAddress
1212

1313

@@ -67,7 +67,7 @@ async def test_writer(self):
6767

6868
class TestOpenConnection(IsolatedAsyncioTestCase):
6969
async def test1(self):
70-
with patch("nicett6.connection.open", side_effect=ValueError("Test")):
70+
with patch("nicett6.tt6_connection.open", side_effect=ValueError("Test")):
7171
with self.assertRaises(ValueError):
7272
async with open_connection():
7373
pass

0 commit comments

Comments
 (0)