def set_meters
      date = params[:date]
      @date = Date.civil(date[:year].to_i, date[:month].to_i, date[:day].to_i) if date

      @days = params[:days].to_i if params[:days]
      @names = params[:names].map(&:to_sym) if params[:names]

      @all_names = MeterCat.names
      @date ||= Date.today
      @days ||= DEFAULT_DAYS

      @range = (@date - @days)..@date
      @meters = Meter.to_h(@range, @names)
    end
def set_meters
      date = params[:date]
      @date = Date.civil(date[:year].to_i, date[:month].to_i, date[:day].to_i) if date

      @days = params[:days].to_i if params[:days]
      @names = params[:names].map(&:to_sym) if params[:names]

      @all_names = MeterCat.names
      @date ||= Date.today
      @days ||= DEFAULT_DAYS

      @range = (@date - @days)..@date
      @meters = Meter.to_h(@range, @names)
    end
rubocop:disable Metrics/AbcSize