Skip to content

Commit

Permalink
fixing linter's requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrasko committed Nov 26, 2024
1 parent 3ec4cb7 commit c103d41
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fuel_cells/intelligent_energy_fcm_804_can/firmware.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function main()
config.init({
[INDEX_CONFIG] = { type = 'number', default = 1, required = true },
[SAVE_0x400_CONFIG] = { type = 'boolean', default = false },
[RL6_CONFIG] = {type = 'string'},
[RL6_CONFIG] = { type = 'string' },
}, {
after_write = setup_options,
})
Expand Down Expand Up @@ -62,7 +62,7 @@ function send_properties()
is_serial_number_completed = false
end

if rl6 ~= nil and rl6 ~= "" then
if rl6 ~= nil and rl6 ~= '' then
info['rl6'] = rl6
end

Expand All @@ -82,8 +82,7 @@ function send_telemetry()
local str_0x400
for _, data in pairs(messages_0x400) do
str_0x400 = str_0x400 or ''
local str_0x400_part =
string.format('%02x%02x%02x%02x%02x%02x%02x%02x', string.unpack('I1I1I1I1I1I1I1I1', data))
local str_0x400_part = string.format('%02x%02x%02x%02x%02x%02x%02x%02x', string.unpack('I1I1I1I1I1I1I1I1', data))
str_0x400 = str_0x400 .. ' ' .. str_0x400_part
end
telemetry['messages_0x400'] = str_0x400
Expand Down Expand Up @@ -114,8 +113,7 @@ function can_handler(msg_id, data)
if not is_serial_number_completed then
if string.byte(data, 1) > 127 then
if #temp_serial_number == 8 then
local serial_number_part =
string.char(string.byte(data, 1, 1) - 128, string.byte(data, 2, 8))
local serial_number_part = string.char(string.byte(data, 1, 1) - 128, string.byte(data, 2, 8))
temp_serial_number = temp_serial_number .. serial_number_part
serial_number = temp_serial_number
is_serial_number_completed = true
Expand Down

0 comments on commit c103d41

Please sign in to comment.