Automatically register unknown devices

homa6 months ago

hi! I try configure Automatically register unknown devices my config:

<entry key='database.ignoreUnknown'>false</entry>
<entry key='database.registerUnknown'>true</entry>
<entry key='database.registerUnknown.defaultCategory'>Default</entry>
<entry key='database.registerUnknown.defaultGroupId'>2</entry>

I find small bug. If my deviceid contain dot, for example "ggg.ggg.ggg", in logs I have error:

2024-05-28 00:21:24  INFO: [T849782da] connected
2024-05-28 00:21:24  INFO: [T849782da: osmand < 172.24.0.4] 504f5354202f3f69643d6767672e6767672e6767672674696d657374616d703d31373136383535363833266c61743d35352e3735353836333138393639373237266c6f6e3d33372e3631373639383636393433333539267265616c69703d3138352e32342e34322e3132266f70657261746f723d4e544b2d50412d2532304f626a323426706f7765723d41432676696e3d6767672e6767672e676767267a69703d313434373030267573657249643d6e6167616576253543617026646f6d61696e3d6e61676165762e62697a266c6f67696e74696d653d31382e30352e3230323425323031313a3138266e65745f6e616d653d6e61676165762e62697a267374617475733d6c6f676765642532306f6e26496e74657266616365416c6961733d45746865726e65742676657273696f6e46773d4c6f616465723a332e302532305363726970743a332e312e31266c6f63616c49503d31302e3235352e3235342e313832266368616e6e656c3d6c6f63616c5f73637269707426747970653d4465736b746f702669676e6974696f6e3d747275652673617456697369626c653d312661636375726163793d3026736f7572636569703d3139332e38342e37382e383020485454502f312e310d0a486f73743a20747261636361723a353035350d0a557365722d4167656e743a20707974686f6e2d72657175657374732f322e33322e320d0a4163636570742d456e636f64696e673a20677a69702c206465666c6174650d0a4163636570743a202a2f2a0d0a436f6e6e656374696f6e3a206b6565702d616c6976650d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
2024-05-28 00:21:24  WARN: Unknown device - ggg.ggg.ggg (172.24.0.4)
2024-05-28 00:21:24  INFO: [T849782da: osmand > 172.24.0.4] 485454502f312e31203430302042616420526571756573740d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2024-05-28 00:21:24  INFO: [T849782da] disconnected

without dots new device creating without log entries
update location for devices with dots in deviceid works correctly

Anton Tananaev6 months ago

You're probably missing database.registerUnknown.regex.

homa6 months ago

What syntax for it? I can write

'\.*'

?

Anton Tananaev6 months ago