Skip to content

Commit

Permalink
Cleaned a few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-becker-tridonic-com committed Nov 9, 2021
1 parent 0502228 commit 93191eb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 52 deletions.
1 change: 0 additions & 1 deletion examples/lighting-app/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ cd ~/connectedhomeip/
git submodule update --init
source scripts/activate.sh

#./scripts/build_python_device.sh --chip_mdns platform --chip_detail_logging true
./scripts/build_python_device.sh --chip_detail_logging true

sudo su # dhclient is called, needs root
Expand Down
42 changes: 0 additions & 42 deletions examples/lighting-app/python/lighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
PostAttributeChangeCallback,
)

# from chip.server.types import PostAttributeChangeCallback
from chip.exceptions import ChipStackError

from ctypes import CFUNCTYPE, c_char_p, c_int32, c_uint8
Expand Down Expand Up @@ -48,9 +47,7 @@ async def dali_on(is_on: bool):
global dali_loop
global dev

#print("Waiting for device...")
await dev.connected.wait()
#print(f"Connected, firmware={dev.firmware_version}, serial={dev.serial}")
if (is_on):
await dev.send(RecallMaxLevel(Broadcast()))
else:
Expand All @@ -61,9 +58,7 @@ async def dali_level(level: int):
global dali_loop
global dev

#print("Waiting for device...")
await dev.connected.wait()
#print(f"Connected, firmware={dev.firmware_version}, serial={dev.serial}")
await dev.send(DAPC(Broadcast(), level))


Expand Down Expand Up @@ -95,17 +90,6 @@ def __init__(self, rendezvousAddr=None, controllerNodeId=0, bluetoothAdapter=Non

LightingMgrCmd.command_names.sort()

# self.bleMgr = None

# self.devCtrl = ChipDeviceCtrl.ChipDeviceController(
# controllerNodeId=controllerNodeId, bluetoothAdapter=bluetoothAdapter
# )

# # If we are on Linux and user selects non-default bluetooth adapter.
# if sys.platform.startswith("linux") and (bluetoothAdapter is not None):
# self.bleMgr = BleManager(self.devCtrl)
# self.bleMgr.ble_adapter_select("hci{}".format(bluetoothAdapter))

self.historyFileName = os.path.expanduser("~/.chip-lighting-history")

try:
Expand All @@ -123,20 +107,6 @@ def __init__(self, rendezvousAddr=None, controllerNodeId=0, bluetoothAdapter=Non

command_names = [
"help"
# "setup-payload",
# "ble-scan",
# "ble-adapter-select",
# "ble-adapter-print",
# "ble-debug-log",
# "connect",
# "close-ble",
# "resolve",
# "zcl",
# "zclread",
# "zclconfigure",
# "discover",
# "set-pairing-wifi-credential",
# "set-pairing-thread-credential",
]

def parseline(self, line):
Expand Down Expand Up @@ -213,18 +183,6 @@ def attributeChangeCallback(
size: int,
value: bytes,
):
# print(
# "[PY] AttributeChangeCallback endpoint {} clusterId {} attributeId {} mask {} manufacturerCode {} type {} size {} value {}".format(
# endpoint,
# clusterId,
# attributeId,
# mask,
# manufacturerCode,
# xx_type,
# size,
# value,
# )
# )
global dali_loop
if endpoint == 1:
if clusterId == 6 and attributeId == 0:
Expand Down
10 changes: 1 addition & 9 deletions scripts/build_python_device.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,12 @@ echo "Input values: chip_detail_logging = $chip_detail_logging , chip_mdns = \"$
# Ensure we have a compilation environment
source "$CHIP_ROOT/scripts/activate.sh"

echo "***** mab : activate done"

# Generates ninja files
[[ -n "$chip_mdns" ]] && chip_mdns_arg="chip_mdns=\"$chip_mdns\"" || chip_mdns_arg=""

chip_data_model_arg="chip_data_model=\"///examples/lighting-app/lighting-common\""

gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging enable_pylib=$enable_pybindings enable_rtti=$enable_pybindings chip_use_clusters_for_ip_commissioning=$clusters $chip_mdns_arg chip_python_controller=false $chip_data_model_arg"

echo "***** mab : gn done"
gn --root="$CHIP_ROOT" gen "$OUTPUT_ROOT" --args="chip_detail_logging=$chip_detail_logging enable_pylib=$enable_pybindings enable_rtti=$enable_pybindings chip_use_clusters_for_ip_commissioning=$clusters $chip_mdns_arg chip_controller=false $chip_data_model_arg"

# Compiles python files
# Check pybindings was requested
Expand All @@ -118,13 +114,9 @@ else
ninja -v -C "$OUTPUT_ROOT" python
fi

echo "***** mab : ninja done"

# Create a virtual environment that has access to the built python tools
virtualenv --clear "$ENVIRONMENT_ROOT"

echo "***** mab : venv done"

# Activate the new environment to register the python WHL

if [ "$enable_pybindings" == true ]; then
Expand Down

0 comments on commit 93191eb

Please sign in to comment.