Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Nov 29, 2023
1 parent 2f05f09 commit 0d427c3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions python/esp_now_ros/smart_device_protocol_interface.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import rospy

import struct
from typing import Callable, Union, List, Tuple, Optional, Dict
from typing import Callable, Dict, List, Optional, Tuple, Union

import rospy

from esp_now_ros.sdp_frames import MetaFrame, DataFrame, BaseFrame
from esp_now_ros.esp_now_ros_interface import ESPNOWROSInterface
from esp_now_ros.packet_parser import parse_packet_as_v2
from esp_now_ros.msg import Packet
from esp_now_ros.packet_parser import parse_packet_as_v2
from esp_now_ros.sdp_frames import BaseFrame, DataFrame, MetaFrame


class SDPInterface:
Expand Down Expand Up @@ -103,8 +103,10 @@ def _remove_timeout_device(self):
@property
def device_interfaces(self):
return self._device_interfaces

def send(self, target: Union[Tuple, str], frame: Union[DataFrame, MetaFrame], num_trial=1):

def send(
self, target: Union[Tuple, str], frame: Union[DataFrame, MetaFrame], num_trial=1
):
if isinstance(target, str):
for src_address, device_interface in self._device_interfaces.items():
if device_interface["device_name"] == target:
Expand All @@ -116,6 +118,7 @@ def send(self, target: Union[Tuple, str], frame: Union[DataFrame, MetaFrame], nu
target_address = target
super().send(target_address, frame, num_trial)


class DeviceDictSDPInterfaceWithInterfaceCallback(DeviceDictSDPInterface):
def __init__(
self,
Expand Down

0 comments on commit 0d427c3

Please sign in to comment.