Skip to content

Commit 545eb4c

Browse files
steffenmllride
authored andcommitted
toLowerCase the dash buttons mac address
1 parent b394cf8 commit 545eb4c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/DashButton.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class DashButton {
3838
_isResponding: boolean;
3939

4040
constructor(macAddress: string, options: DashButtonOptions = {}) {
41-
this._macAddress = macAddress;
41+
this._macAddress = macAddress.toLowerCase();
4242
this._networkInterface = options.networkInterface || nullthrows(NetworkInterfaces.getDefault());
4343
this._packetListener = this._handlePacket.bind(this);
4444
this._dashListeners = new Set();

src/__tests__/DashButton-test.js

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ describe('DashButton', () => {
2323
jest.resetModules();
2424
});
2525

26+
it(`should normalize (lowercase) the dash buttons MAC address`, () => {
27+
let button = new DashButton('00:11:AA:33:44:BB');
28+
29+
expect(button._macAddress).toEqual('00:11:aa:33:44:bb');
30+
});
31+
2632
it(`creates a pcap session the first time a listener is added`, () => {
2733
let button = new DashButton(MAC_ADDRESS);
2834
button.addListener(() => {});

0 commit comments

Comments
 (0)